Forum Moderators: open

Message Too Old, No Replies

Problem with File DSN

         

kevinj

2:16 am on May 3, 2003 (gmt 0)

10+ Year Member



I'm having a problem with a file DSN. I always use system DSNs but am working with a new host and cannot get them to set up a DSN for me. So I'm trying to set up my first file DSN. Here's the code:

DBConn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\database\sharpeworldmusic.mdb")
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "SELECT * From Calendar WHERE archive_event=1, DBConn", 1, 3

I'm getting an error on the RS.Open line. The error is:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

Does anyone have any idea what is wrong?

All I want to do is view the records from this database, not update them.

Thanks in advance for any help. This has been extremely frustrating.

le_gber

7:04 am on May 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Just a thought have you tried using / instead of \ for the path?

Leo

aspdaddy

7:07 am on May 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Im not certain as I dont use the recordset that way but is that the correct syntax?

RS.Open "SELECT * From Calendar WHERE archive_event=1, DBConn", 1, 3

Shouldnt you close the double quotes AFTER THE sql, like this:

RS.Open "SELECT * From Calendar WHERE archive_event=1", DBConn, 1, 3

kevinj

1:59 pm on May 3, 2003 (gmt 0)

10+ Year Member



Thanks ASPDaddy

I changed the recordset statement to:

Rs.Open "SELECT * From Calendar WHERE archive_event=1", DBConn, 1, 3

and no longer get that error, but now I get:

Unrecognized database format 'd:\path\database\sharpeworldmusic.mdb'.

from the line of code that reads:
DBConn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\database\sharpeworldmusic.mdb")

Any thoughts anyone?

[edited by: Xoc at 4:04 am (utc) on May 4, 2003]

kevinj

2:01 pm on May 3, 2003 (gmt 0)

10+ Year Member



The error is actually from the RS.Open line but comes from the Server.MapPath line.

duckhunter

2:57 am on May 4, 2003 (gmt 0)

10+ Year Member



Try using version 3.51 instead of 4.0 or possibly an upgrade to ADO 2.6 and latest Access Patches to utilize version 4.0

There's a MSFT Known Issue on this due to recent changes in the jet engine to offer ANSI support for foreign languages: [support.microsoft.com ]