|
-
Mar 27th, 2000, 07:39 AM
#1
Thread Starter
Lively Member
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
-
Mar 27th, 2000, 08:14 AM
#2
Lively Member
Access 2000
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.
-
Mar 28th, 2000, 06:40 AM
#3
Addicted Member
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?
-
Mar 28th, 2000, 07:03 AM
#4
Frenzied Member
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".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|