PDA

View Full Version : ...no default driver specified


mattboy_slim
04-30-2003, 05:11 PM
Trying to use Dreamweaver to set up my database connection and queries, but it's not going well.

Getting the following standard message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/reporting/Default.asp, line 5



<%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_Quarantine_STRING = "dsn=Quarantine;"
%>
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_Quarantine_STRING;
Recordset1.Source = "SELECT * FROM tblMsgCatalog";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>


The problem line is:

Recordset1.ActiveConnection = MM_Quarantine_STRING;


If you need more information let me know. Thanks.

Roy Sinclair
04-30-2003, 06:16 PM
Do you have a "system" DSN named Quarantine set up on the server where the ASP page is run? It should be a system DSN since the account the ASP page runs under isn't likely to be the same account you log into the server with so a "use" DSN doesn't work.

oracleguy
04-30-2003, 06:52 PM
And most hosts charge money for DSNs, the alternative is to use a DSNless connection, which isn't too hard to do.

mattboy_slim
04-30-2003, 06:53 PM
Well I'm my own host, so no worry there.

Tell me about DSNless connections. I'm not too keen on writing any custom connection strings, but if I can get connected to this DB, I'll do anything.

And I set up the DSN on the server. Still no luck.

mattboy_slim
04-30-2003, 06:59 PM
Update:

Now I'm getting the following:

ADODB.Recordset error '800a0bb9'

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

/reporting/Default.asp, line 13


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
cst = "Driver={Microsoft Access Driver (*.mdb)};DBQ="
cst = cst & server.mappath("quarantine.mdb")
set conn = Server.CreateObject("ADODB.Connection")
conn.open cst
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_Reporting_STRING
Recordset1.Source = "SELECT * FROM tblMsgCatalog"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>

raf
04-30-2003, 07:14 PM
I just use this for a dsn-less connection

<%
dim conConnectionname
set conConnectionname=server.CreateObject("adodb.connection")
conConnectionname.Open("provider=microsoft.jet.oledb.4.0;data source="&server.MapPath("dbadresss"))
%>

Need to replace the italics. Just choos the connectioname you want and just insert the (relative) db-adress or filename if the db is in the same directory.

I always just put this code in an includefile. (SSI)

DSN-less is faster and not more difficult.