home *** CD-ROM | disk | FTP | other *** search
Wrap
linkDLL "sql.dll" INT SqlCursorClose(WORD, POINTER) SqlCusrsorOpen( <DescribeColumn( ZDescribeTable( wExecute( j, STRING) FetchFirst( FetchLast( FetchPrevious( FetchNext( FetchPositioned( , LONG, GetStatus( SqlLogin( Logout( kernel" gGlobalAlloc( GlobalLock( GlobalUnlock( gGlobalFree( GlobalSize( enterBook enterBook sql.dll SqlCursorClose SqlCusrsorOpen SqlDescribeColumn SqlDescribeTable SqlExecute SqlFetchFirst SqlFetchLast SqlFetchPrevious SqlFetchNext SqlFetchPositioned SqlGetStatus SqlLogin SqlLogout kernel GlobalAlloc GlobalLock GlobalUnlock GlobalFree GlobalSize System i, STRING) FetchFirst( FetchLast( FetchPrevious( FetchNext( FetchPositioned( , LONG, GetStatus( SqlLogin( Logout( kernel" gGlobalAlloc( GlobalLock( GlobalUnlock( gGlobalFree( GlobalSize( -- cover functions -- These will have the same pwithout enterBook enterBook sql.dll SqlCursorClose SqlCursorOpen SqlDescribeColumn SqlDescribeTable SqlExecute SqlFetchFirst SqlFetchLast SqlFetchPrevious SqlFetchNext SqlFetchPositioned SqlGetStatus SqlLogin SqlLogout kernel GlobalAlloc GlobalLock GlobalUnlock GlobalFree GlobalSize This book contains an example of the Quasar SQL for Windows DLLL control Error detail: Error Msg: Hilite Length: 0 Hilite Offset: 0 Padding: 0 Record Buff. Size: 59 Result Code: 0 Hilite Offset: 0 Padding: 0 Record Buff. Size: 30 Result Code: 69 te Offset: 0 Padding: 0 Record Buff. Size: 52 Result Code: 0 4loggedIn FALSE "Must Log In First" 4ptrControl, hUser, hCursor ("Enter SQL Query" query doit buttonup buttonup Must Log In First Enter SQL Query cancel query query ptrControl hUser hCursor loggedIn Ad Hoc Query status Number of Deletes: 0 Number of Inserts: 0 Number of Selects: 6 Number of Updates: 0 Elapsed Time (msec): 160 query select * from p; ere 'Rome' = (select city from j where j.jno = spj.jno); select * from spj; 4hUser, hCursor login() CursorOpen( GetStatus( buttonup buttonup login CursorOpen GetStatus hUser hCursor Login 4hUser Logout( buttonup buttonup Logout hUser logout 4loggedIn FALSE "Must Log In First" opendlg("c:\temp","*.sql", "Choose a query file...","SQLTBK") sqlFile IsqlFIle o(26) buttonup buttonup Must Log In First c:\temp *.sql Choose a query file... SQLTBK opendlg sqlFIle query sqlFile loggedIn File Query results P6 Cog Red 19London P5 Cam Blue 12Paris P4 Screw Red 14London P3 Screw Blue 17Rome P2 Bolt Green 17Paris P1 Nut Red 12London about buttonUp buttonUp This Book is an example of using the QUASAR SQL For Windows API under ToolBook. This was just writen to see if the two products would integrate. I have not performed all the error checking I would do in final product nor has it been optimized. This code has not gone through a formal QA process and is distributed AS IS. Tech Support can NOT assist with this product, but bug reports will be accepted, This uses the Quasar SQL for Windows Engine from Stellar Industries 3335 S. Falcon Ridge Rd. Diamond Bar, CA 91765 (714) 861-7885 about buttonUp buttonUp about :PHYSSIZE 4cursList, 9,12,10,11 results spin option athe cursor "reset" k4 + 1) 4ptrControl, hUser, hCursor, ptrStatus stat s_execute( "query") getStatus ( JHCursor) U) > 0 -- did table DescribeTable( !>= 1 hrecBuff GlobalAlloc(66, globalLock( .(328, |) -- init control struct ctrlDump FetchFirst( GetStatus( temp 1(0, && CRLF ) - 1) FetchNext( 1(0, globalUnlock( globalFree( terPage enterPage enterPage results cursList reset cursList option query s_execute HCursor getStatus DescribeTable GlobalAlloc globalLock wctrlDump FetchFirst GetStatus FetchNext GetStatus globalUnlock globalFree reset results recBuff hrecBuff table ptrControl hUser hCursor ptrStatus 4hControl, ptrControl, hColumn, ptrColumn, hTable, ptrTable, hStatus, ptrStatus e"About SQL.TBK" c"Help" "dba.exe" "The Quasar Database Administrator could xbe loaded" & CRLF &\ "Run DBA.EXE 4attempting access" linkDLL "c:\ $\sql.dll" INT SqlCursorClose(WORD, POINTER) SqlCursorOpen( ;DescribeColumn( YDescribeTable( vExecute( i, STRING) FetchFirst( ]pointers instead strings FetchLast( the fetches because FetchPrevious( -- buffer explicitly allocated FetchNext( FetchPositioned( , LONG, GetStatus( SqlLogin( Logout( kernel" gGlobalAlloc( GlobalLock( GlobalUnlock( gGlobalFree( GlobalSize( tbkdlg. opendlg( globalAlloc(66,358) globalLock( table descriptor -- cover functions -- These will have same pwithout 'Sql' aboutSQLTBK loggedIn ("User Name" f"SYSTEM" uname ("Password" f"QUASAR" userHandle ?,pw) ctrlDump Failed" "failed" hUser stat SqlLogout( FALSE "control" "Error detail:"&& Msg:"&& 1(66, "Hilite Length:"&& .(322, #Offset:"&& .(324, "Padding:" && .(326, "Record Buff. :" && .(328, "Result Code:" && .(330, cursorHandle , hCursor SqlDescribeTable( -- record , colNumber SqlDescribeColumn( S_execute , query SqlExecute( SqlFetchFirst( SqlFetchLast( SqlFetchNext( , pos, , hCusrsor, SqlFetchPrevious( SqlGetStatus( "status" Deletes:"&& Inserts:"&& Selects:"&& Updates:"&& /(12, "Elapsed Time (msec):" && /(16, globalUnlock ( globalFree aboutSQLTBK enterBook ctrlDump leaveBook CursorOpen DescribeColumn S_execute Logout FetchFirst CursorClose FetchLast FetchNext Login FetchPosition DescribeTable FetchPrevious GetStatus enterBook About SQL.TBK dba.exe The Quasar Database Administrator could not be loaded Run DBA.EXE before attempting access c:\temp\sql.dll SqlCursorClose SqlCursorOpen SqlDescribeColumn SqlDescribeTable SqlExecute SqlFetchFirst SqlFetchLast SqlFetchPrevious SqlFetchNext SqlFetchPositioned SqlGetStatus SqlLogin SqlLogout kernel GlobalAlloc GlobalLock GlobalUnlock GlobalFree GlobalSize tbkdlg.dll opendlg q globalAlloc globalLock globalAlloc globalLock globalAlloc globalLock globalAlloc globalLock hControl ptrControl hColumn ptrColumn hTable ptrTable hStatus ptrStatus aboutSQLTBK about Login User Name SYSTEM Password QUASAR SqlLogin wctrlDump Login Failed failed userHandle uname ptrControl loggedIn Logout SqlLogout wctrlDump Logout Failed failed userHandle ptrControl loggedIn hUser ctrlDump control Error detail: Error Msg: Hilite Length: Hilite Offset: Padding: Record Buff. Size: Result Code: ptrControl CursorOpen SqlCursorOpen wctrlDump CursorOpen Failed failed cursorHandle ptrControl hUser CursorClose SqlCursorClose wctrlDump CursorClose Failed failed cursorHandle ptrControl hCursor hUser DescribeTable SqlDescribeTable wctrlDump DescribeTable Failed failed ptrControl ptrTable hCursor hUser DescribeColumn SqlDescribeColumn wctrlDump DescribeColumn Failed failed ptrControl ptrColumn colNumber hCursor hUser S_execute SqlExecute wctrlDump S_execute Failed failed ptrControl query hCursor hUser FetchFirst SqlFetchFirst wctrlDump FetchFirst Failed failed ptrControl buffer hCursor hUser FetchLast SqlFetchLast wctrlDump FetchLast Failed failed ptrControl buffer hCursor hUser FetchNext SqlFetchNext wctrlDump FetchNext Failed failed ptrControl buffer hCursor hUser FetchPosition SqlFetchFirst wctrlDump FetchPosition Failed failed ptrControl buffer hCursor hUser FetchPrevious SqlFetchPrevious wctrlDump FetchPrevious Failed failed hCursor ptrControl buffer hCusrsor hUser GetStatus SqlGetStatus wctrlDump GetStatus Failed failed status Number of Deletes: Number of Inserts: Number of Selects: Number of Updates: Elapsed Time (msec): ptrControl ptrStatus hCursor hUser leaveBook globalUnlock globalFree globalUnlock globalFree globalUnlock globalFree globalUnlock globalFree hControl hColumn hTable hStatus