Solved

Error inserting into MDB.

Posted on 2004-04-12
4
349 Views
Last Modified: 2006-11-17
Hi
I am getting an error when I try to insert to my mdb database

my connection is being set up using:

Set OpenDB = Server.CreateObject("ADODB.Connection")
OpenDB.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db.mdb")

and i am recieving the following error:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Provider=MSDASQL.1;E'

Any ideas would be appreciated!

Thanks



0
Comment
Question by:pinmj001
  • 2
4 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 10804344
Try using OLEDB Connection instead:

Example:

set OpenDB =server.CreateObject("adodb.connection")
OpenDB.Open "Provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("../db.mdb")

..

More info regarding ConnectionString available at:            

http://www.able-consulting.com/ADO_Conn.htm
http://www.connectionstrings.com

cheers
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 10804507
Make sure you have the latest version of MDAC installed in your server. Otherwise, try changing the connection string as mentioned by ryancys.

Cheers!!
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 500 total points
ID: 10804518
Are you trying to open the connection inside a function?. If so, you need to use the Set keyword to assign the connection to the function..

eg:

Public Function openConnection()
Dim ConnectionString
Dim Connection

ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};"
ConnectionString=ConnectionString & "DBQ=" & accessdb

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open(ConnectionString)

Set openConnection = Connection '** MAKE SURE TO USE SET KEYWORD **
End Function

Cheers!!
0
 

Author Comment

by:pinmj001
ID: 10804913
Thanks you were correct, I had to call the function using set

Cheers!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Classic ASP - cannot get to correct path 17 73
JQuery Date Time picker not showing 29 133
Adding Datediff to staistics page 2 57
Query still returning duplicates 5 32
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question