connecting readonly a .mdb MS ACCESS

forum.connectivity (1998-2005) & forum.td.connectivity (2005-2010)
LarryM

connecting readonly a .mdb MS ACCESS

Post by LarryM » 26 Sep 2008, 12:41

 Posted by:  LarryM 

Hi NG:

I have problem connecting readonly a .mdb MS ACCESS file.
Does anyone have an example of ODBC MS ACCES DB connectivity read only?

TIA

Larry

Mike

connecting readonly a .mdb MS ACCESS

Post by Mike » 06 Oct 2008, 13:25

 Posted by:  Mike 

!!CB!! 70
Set SqlDatabaseOld=SqlDatabase
Set SqlUserOld=SqlUser
Set SqlPasswordOld=SqlPassword
Set SqlDatabase=''
Set SqlUser='Admin'
Set SqlPassword=''
If not SqlCreateSession(hSession,'Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source=' || sAccessFileName)
Call fMsgBox('Database can not be opened')
Return FALSE
If not SqlCreateStatement(hSession,hSqlODBC)
Call fMsgBox('Database session can not be opened')
Return FALSE
Set SqlDatabase=SqlDatabaseOld
Set SqlUser=SqlUserOld
Set SqlPassword=SqlPasswordOld
....

Set bRes=SqlGetSessionHandle(hSqlODBC,hSession)
Set bRes=SqlFreeSession(hSession)

Return to “td.connectivity”

Who is online

Users browsing this forum: [Ccbot] and 19 guests