We help IT Professionals succeed at work.

Error inserting into MDB.

pinmj001
pinmj001 asked
on
372 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



Comment
Watch Question

Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT

Commented:
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
Make sure you have the latest version of MDAC installed in your server. Otherwise, try changing the connection string as mentioned by ryancys.

Cheers!!
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks you were correct, I had to call the function using set

Cheers!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.