Thursday, March 22, 2012

ASP Connection String To SQL Server

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>You have to first set oConn to a new instance of the ADODB connection
object.
"qqqq" <dddh@.ddd.clc> wrote in message
news:BW0Xb.4715$vo1.1496@.newsfep4-winn.server.ntli.net...
> 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>
>|||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.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

No comments:

Post a Comment