PDA

Click to See Complete Forum and Search --> : Help with Access database.


paul
Mar 27th, 2000, 06:39 AM
Hi
I am writing a program using MSAccess Database (Office2000)I am getting an error when I choose the recordset.The error states unrecognized database format. What am I doing wrong?
thanks

Nias
Mar 27th, 2000, 07:14 AM
You have to do it the hard way.

Change your references to DAO 3.6 and try something like:

Dim daodb36 As Database
Dim rs As DAO.Recordset
Dim strQuery As String
'set strQuery to table name, query name or SQL string
strDBPath = "c:\dbpath\dbname.mdb"
Set daodb36 = DBEngine.OpenDatabase(strDBPath)
Set rs = daodb36.OpenRecordset(strQuery)


'Read database

with rs
.movefirst
if !fldname1 <> "NULL" then
txtbox1.text = !fldname1
else
txtbox1.text = " "
end if

end with


There is a web page on MSDN that better explains it but this is what I had to do to code with Office 2000 stuff with VB6. Hopefully VB7 will have the updates.

Bebe
Mar 28th, 2000, 05:40 AM
what is the ! used for is that what you have to put in front of the database field name for it to work; just proper syntax?

JHausmann
Mar 28th, 2000, 06:03 AM
Bebe, It's called a "bang" (stupid name if you ask me) and it tells VB that what follows belongs to a collection. In this case, it's pointing back to the recordset "rs".