Local lcDatabase, lcUser, lcPassword, lnHandle
lcDatabase = "my.db"
lcUser = "user"
lcPassword = "password"
lnHandle = db_connect(lcDatabase, lcUser, lcPassword)
If lnHandle>=0
Local lcAlias
lcAlias = "mycursor"
SQLExec(lnHandle,"select * from mytable",lcAlias)
Select (lcAlias)
Browse
db_disconnect(lnHandle)
Else
? "connect failed"
Endif
Procedure db_connect()
Lparameters tcDatabase, tcUser, tcPassword
Local lnHandle
strng="DRIVER=SQLite3 ODBC Driver;Database=d:\mydb.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;"
lnHandle = Sqlstringconnect(strng)
Return lnHandle
Endproc
Procedure db_disconnect()
Lparameters tnHandle
SQLDisconnect(tnHandle)
Endproc
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 82 guests