Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / December 2004



Tip: Looking for answers? Try searching our database.

using vb6 and access 2000 continued

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howie429 - 29 Dec 2004 08:25 GMT
i tried using the following code using a database originally created in
access97 and updated to 2000.

when i ran the code i got the error msg at the end of posting.  however when i
tried using a 2 year old backup still in 97 format it worked.

i appreciate any help

howard

oh yes in a previous post i got questions about books.  it's for discounts on
my comic sales.

Private Sub Form_Load()

Dim adoConnection As ADODB.Connection
Dim NjcSet  As ADODB.Recordset
Dim ConnectString As String

Set adoConnection = New ADODB.Connection
Set NjcSet = New ADODB.Recordset

ConnectString = "provider=microsoft.jet.oledb.3.51;" _
   & "Data source=d:\NotJustComics\NjcInventory.Mdb"
   
adoConnection.Open ConnectString
NjcSet.Open "Comics", adoConnection

error message

Runtime Error '-2147467259(800040005)';
unrecognized database format 'd:\notjustcomics\njcinventory.mdb'
eschuylerTAKE@THISadelphiaOUT.net - 29 Dec 2004 13:08 GMT
>i tried using the following code using a database originally created in
>access97 and updated to 2000.
[quoted text clipped - 28 lines]
>Runtime Error '-2147467259(800040005)';
>unrecognized database format 'd:\notjustcomics\njcinventory.mdb'

Howie,

Try changing "oledb.3.51" to "oledb.4.0" in the connection string.

Regards,
Eric
Howie429 - 30 Dec 2004 08:32 GMT
i tried what you suggested and this error came up.

run time error 3709

operation is not allowed on an object referencing a closed or invalid
connection

howard
eschuylerTAKE@THISadelphiaOUT.net - 30 Dec 2004 13:22 GMT
>i tried what you suggested and this error came up.
>
[quoted text clipped - 4 lines]
>
>howard

Howard,

The line

NjcSet.Open "Comics", adoConnection

is trying to open the Comics table, right?

I don't think newer ADO versions allow you to specify just a table name;
they want a real SQL query.

Try this instead:

NjcSet.Open "SELECT * FROM Comics", adoConnection

Regards,
Eric
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.