'
'  SQL.GBL - Header file for Quasar SQL Application Programming Interface
'
'  LANGUAGE      : Microsoft Visual Basic 1.00
'  MODEL         : N/A
'  ENVIRONMENT   : Microsoft Windows 3.0
'
'  Developed by:
'    Philip Roll
'    Ming-Li Wang
'
'  (C) Copyright 1991
'  Stellar Industries
'  3335 S. Falcon Ridge Road
'  Diamond Bar  CA 91765
'  (714) 861-7885

'  Data classes:

Global Const SqlDataClassAPPROXIMATE = 0
Global Const SqlDataClassBINARY = 1
Global Const SqlDataClassCHAR = 2
Global Const SqlDataClassEXACT = 3
Global Const SqlDataClassINVALID = 4

'  Data types:

Global Const SqlDataTypeBINARY = 0
Global Const SqlDataTypeCHAR = 1
Global Const SqlDataTypeDECIMAL = 2
Global Const SqlDataTypeDOUBLE = 3
Global Const SqlDataTypeFLOAT = 4
Global Const SqlDataTypeINTEGER = 5
Global Const SqlDataTypeNUMERIC = 6
Global Const SqlDataTypeREAL = 7
Global Const SqlDataTypeSMALLINT = 8
Global Const SqlDataTypeVARCHAR = 9
Global Const SqlDataTypeINVALID = 10

'  Error codes:

Global Const SqlErrorAmbiguousColumn = 1
Global Const SqlErrorBadEnvironment = 2
Global Const SqlErrorBinaryNotAllowed = 3
Global Const SqlErrorCannotActivateFile = 4
Global Const SqlErrorCannotCloseFile = 5
Global Const SqlErrorCannotCloseLog = 6
Global Const SqlErrorCannotCreateDataFile = 7
Global Const SqlErrorCannotCreateDumpFile = 8
Global Const SqlErrorCannotCreateFile = 9
Global Const SqlErrorCannotCreateKeyFile = 10
Global Const SqlErrorCannotCreateLog = 11
Global Const SqlErrorCannotDeleteFile = 12
Global Const SqlErrorCannotDropTable = 13
Global Const SqlErrorCannotOpenDataFile = 14
Global Const SqlErrorCannotOpenFile = 15
Global Const SqlErrorCannotOpenKeyFile = 16
Global Const SqlErrorCannotOpenLog = 17
Global Const SqlErrorCannotRemoveTable = 18
Global Const SqlErrorCharNotAllowed = 19
Global Const SqlErrorCheckpointDetected = 20
Global Const SqlErrorDataFileCorrupted = 21
Global Const SqlErrorDatabaseCorrupt = 22
Global Const SqlErrorDbaNotAvailable = 23
Global Const SqlErrorDivideByZero = 24
Global Const SqlErrorDuplicateColumn = 25
Global Const SqlErrorDuplicateRecord = 26
Global Const SqlErrorExistingDataFile = 27
Global Const SqlErrorExistingKeyFile = 28
Global Const SqlErrorFileReadFailed = 29
Global Const SqlErrorFileSeekFailed = 30
Global Const SqlErrorFileWriteFailed = 31
Global Const SqlErrorGlobalLockFailed = 32
Global Const SqlErrorGlobalUnlockFailed = 33
Global Const SqlErrorImportParseError = 34
Global Const SqlErrorIncompatibleTypes = 35
Global Const SqlErrorIndexExists = 36
Global Const SqlErrorIndexUndoFailed = 37
Global Const SqlErrorInitializationFailed = 38
Global Const SqlErrorInsufficientBuffer = 39
Global Const SqlErrorInternalError = 40
Global Const SqlErrorInvalidColumnSpec = 41
Global Const SqlErrorInvalidColumnType = 42
Global Const SqlErrorInvalidCursor = 43
Global Const SqlErrorInvalidData = 44
Global Const SqlErrorInvalidEscapeChar = 45
Global Const SqlErrorInvalidPattern = 46
Global Const SqlErrorInvalidTableID = 47
Global Const SqlErrorInvalidUser = 48
Global Const SqlErrorKeyFileCorrupted = 49
Global Const SqlErrorListSizesUnequal = 50
Global Const SqlErrorMultipleSelects = 51
Global Const SqlErrorNoColumnExists = 52
Global Const SqlErrorNoIndexExists = 53
Global Const SqlErrorNoOldRecord = 54
Global Const SqlErrorNoTableExists = 55
Global Const SqlErrorNoUserExists = 56
Global Const SqlErrorNodeSizeTooSmall = 57
Global Const SqlErrorNotAggregate = 58
Global Const SqlErrorNotGroupingColumn = 59
Global Const SqlErrorNotInGroupedTable = 60
Global Const SqlErrorNotSingleRecord = 61
Global Const SqlErrorNullInNotNullCol = 62
Global Const SqlErrorNullNotAllowed = 63
Global Const SqlErrorParserSyntaxError = 64
Global Const SqlErrorParserStackOverflow = 65
Global Const SqlErrorPrecisionConflict = 66
Global Const SqlErrorResultTableExists = 67
Global Const SqlErrorScaleOverflow = 68
Global Const SqlErrorSecurityViolation = 69
Global Const SqlErrorSetFunctionsNested = 70
Global Const SqlErrorStarNotAllowed = 71
Global Const SqlErrorSubqueryNotOneColumn = 72
Global Const SqlErrorTableConflict = 73
Global Const SqlErrorTableExists = 74
Global Const SqlErrorTooManyColumnNames = 75
Global Const SqlErrorTooManyTablesOpen = 76
Global Const SqlErrorTrialSizeExceeded = 77
Global Const SqlErrorVariableHeaderMark = 78
Global Const SqlErrorVariableHeaderSize = 79
Global Const SqlErrorVariableHeaderWrong = 80
Global Const SqlErrorVariableHeaderZero = 81
Global Const SqlErrorWrongVersion = 82

'  Record structure formats:

Global Const SqlFlagFormatPadded = 0
Global Const SqlFlagFormatString = 1
Global Const SqlFlagFormatStructure = 2

'  Auto commit options:

Global Const SqlFlagAutoCommitOnLogout = 16

'  Maximum number of significant characters in named entity:

Global Const SqlMaximumNameLength = 32

'  Global types:

Type SqlColumnType
  RightJustified As Integer
  ColumnHeading As String * 33
  ColumnSequenceNumber As Integer
  DataType As Integer
  DataClass As Integer
  FieldWidth As Integer
  Precision As Integer
  Scale As Integer
End Type

Type SqlControlType
  ErrorDetail As String * 65
  ErrorMessage As String * 257
  HiLiteLength As Integer
  HiLiteOffset As Integer
  Padding As Integer
  RecordBufferSize As Integer
  ResultCode As Integer
  RecordPosition As Long
  Reserved0 As Long
  Reserved1 As Long
  Reserved2 As Long
  Reserved3 As Long
  Reserved4 As Long
  Flags As Integer
End Type

Type SqlStatusType
  NumberOfRecordDeletes As Long
  NumberOfRecordInserts As Long
  NumberOfRecordSelects As Long
  NumberOfRecordUpdates As Long
  TimeElapsed As Long
End Type

Type SqlTableType
  NumberOfColumns As Integer
  RecordSize As Integer
  NumberOfRecords As Long
End Type

'  Function prototypes:

Declare Function SqlCursorClose Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType) As Integer
Declare Function SqlCursorOpen Lib "sql.dll" (ByVal User As Integer, SqlControl As SqlControlType) As Integer
Declare Function SqlDescribeColumn Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal ColumnNumber As Integer, SqlColumn As SqlColumnType) As Integer
Declare Function SqlDescribeTable Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, SqlTable As SqlTableType) As Integer
Declare Function SqlExecute Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal QueryText As String) As Integer
Declare Function SqlFetchFirst Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal RecordBuffer As String) As Integer
Declare Function SqlFetchLast Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal RecordBuffer As String) As Integer
Declare Function SqlFetchNext Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal RecordBuffer As String) As Integer
Declare Function SqlFetchPositioned Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal RecordPosition As Long, ByVal RecordBuffer As String) As Integer
Declare Function SqlFetchPrevious Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, ByVal RecordBuffer As String) As Integer
Declare Function SqlGetStatus Lib "sql.dll" (ByVal User As Integer, ByVal Cursor As Integer, SqlControl As SqlControlType, SqlStatus As SqlStatusType) As Integer
Declare Function SqlLogin Lib "sql.dll" (SqlControl As SqlControlType, ByVal UserName As String, ByVal UserPassword As String) As Integer
Declare Function SqlLogout Lib "sql.dll" (ByVal User As Integer, SqlControl As SqlControlType) As Integer
