Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Works with Access 97 but not Access 2k


Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2000, 05:05 PM
dcbeere
Guest
 
Posts: n/a
Default Works with Access 97 but not Access 2k


I am using a list box to display touples from an Access 2000 database. I am using an ADO control. The touples are displayed fine, but when one is clicked it does not pass the other attributes to other textboxes. It gets hung up on the OpenDatabase command, I get a run-time error (3343) that says that it is a unrecognized database format. The following code works perfectly using Access 97 and a DAO control. How can I make this work with Access 2000 and an ADO control?

Private Sub DataList1_Click()
Dim db As Database
Dim rs1 As Recordset
Dim s1 As String

cName = DataList1.Text

Set db = OpenDatabase("C:db1.mdb") 'ERROR IS HERE

s1 = "SELECT * FROM Table1 WHERE Table1.name = '" & cName & "'"

Set rs1 = db.OpenRecordset(s1)

zipCode = rs1("zip")

Text2.Text = zipCode

Set db = Nothing
End Sub

Reply With Quote
  #2  
Old 10-21-2000, 06:33 PM
xena
Guest
 
Posts: n/a
Default Re: Works with Access 97 but not Access 2k

What's your workspace?

Set db = workspace.OpenDatabase("C:db1.mdb")



Reply With Quote
  #3  
Old 10-24-2000, 06:11 AM
whelanp
Guest
 
Posts: n/a
Default Re: Works with Access 97 but not Access 2k

Declare you Db Vars as

dim rs as DAO.Recordset
dim db as DAO.Database

Reply With Quote
  #4  
Old 10-27-2000, 07:37 AM
ca8msm
Guest
 
Posts: n/a
Smile Re: Works with Access 97 but not Access 2k

I had same problem. Download Service Pack 4.0 from www.microsoft.com and all will be fixed. (55Mb)

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->