Solved

Error inserting into MDB.

Posted on 2004-04-12
4
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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