devxlogo

ADO connection to an mdb database fails

ADO connection to an mdb database fails

Question:
Summary of the problem: Connecting directly to a Microsoft Access database from a Web project developed in Interdev 6.0 fails unless I modify every .Open to use a connection string constructed on the spot [as opposed to .Open Application(‘Blah_ConnectionString’) … ]

For example: Using the Gallery sample provided and built by InterDev 6.0 produces a connection string in Global.asa as follows:

Application("Gallery_ConnectionString") = "DBQ=\myserverwww$Gallery.mdb;DefaultDir=\myserver www$;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;Threads=3;UID=admin;UserCommitSync=Yes;;User Id=admin;"

Yet all attempts to use the connection from ADO components such as within ADO Recordset produce the following error:

---------------------------------------------------------------------------------------------ADODB.Connection error '800a0bb9' The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. /Gallery/DEntry/Entry.asp, line 188---------------------------------------------------------------------------------------------

Line 188 in Entry.asp actually points to the line before the .Open. However, the nature of the error message and past fixes where I corrected the error by modifying the .Open implies that the statement containing .Open is the problem. Here are lines 188 and 189:

188> DBConn.CursorLocation = Application('Gallery_CursorLocation');189> DBConn.Open(Application('Gallery_ConnectionString'), Application('Gallery_RuntimeUserName'), Application('Gallery_RuntimePassword'));

The implications of this problem are that the scope of the Application object established within Global.asa is not in fact global to the project. Which implies that the Web server has been incorrectly configured? This is my current working hypothesis.

Answer:
Perhaps this is a dumb observation, but if you have actually pasted your problem lines 188 and 189 from your actual code, then I notice that you are using a single quote in your code. That’s the comment character in VBScript and may be the cause of your problems:

188> DBConn.CursorLocation = Application('Gallery_CursorLocation');

I would explore that first.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist