Groups | Blog | Home
all groups > sql server odbc > february 2004 >

sql server odbc : ASP Connection String To SQL Server


qqqq
2/13/2004 9:38:37 AM
Hi

This is new to me.

I am trying to connect an asp page to sql server.

Any help would be gratefully appreciated

I get the error message:
Technical Information (for support personnel)

a.. Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/idataconnection.asp, line 10


b.. Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

c.. Page:
GET /idataconnection.asp


The code I have in the page is:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<%
oConn.Open "DSN=pubs;" & _
"Uid=testuser;" & _
"Pwd=123"
%>
</body>
</html>

User
2/13/2004 9:46:31 AM
You have to first set oConn to a new instance of the ADODB connection
object.


[quoted text, click to view]

Ayaz Ahmed
3/19/2004 10:28:49 PM
Hello,

try this

<%
set conn1=server.CreateObject("adodb.connection")
conn1.cursorlocation=3
conn1.Open "Provider=sqloledb;" & _
"Data Source=DB;" & _
"Initial Catalog=ayaz;" & _
"User Id=ayaz;" & _
"Password=ayaz"

%>

Thanks,


Warm Regards,

Ayaz Ahmed
Software Engineer & Web Developer
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Karachi, Pakistan
Mobile +92 300 2280950
Office +92 21 455 2414

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button