Solved

Error inserting into MDB.

Posted on 2004-04-12
4
348 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now