By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,042 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,042 IT Pros & Developers. It's quick & easy.

help is definately need..please TIA

P: n/a
ron
I can't figue out whats wrong. I am a newbie to sql, however i'm totally
lost. i get this error.

"Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
login.asp, line 9"
this is my code.
<!--#include file=connection.asp-->
<%
bGoodAttempt = False
if Request.Form(".submit") = "Login" then
strName = Replace(Request.Form("login"),"'","")
strPass = Request.Form("pass")

sqlStmt = "ValidateLogin @LoginName='" & strName & "'"
oDb.Open strconn
oRs.Open sqlStmt,oDb,adOpenForwardOnly,adLockReadOnly,adCmd Text
if oRs.Eof then
'Failed Login Attempt
strMsg = "Invalid Login Name or Password"
else
if strPass = oRs("Password") then
'Successful Login Attempt
Session("loginid") = oRs("PKID")
Session("name") = oRs("LoginName")
Session("verified") = True
bGoodAttempt = True
else
strMsg = "Invalid Login Name or Password"
end if
end if
oRs.Close
oDb.Close
end if
Set oRs = Nothing
Set oDb = Nothing
if bGoodAttempt then
Response.Redirect "admin.asp"
end if

%>

any help would be greatly appriciated. by the way, it's an ASP webpage.

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
This may be due to a malformed connection string. Post the contents of
connection.asp and perhaps someone can spot the problem.

--
Hope this helps.

Dan Guzman
SQL Server MVP

-----------------------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index....partmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------

<ro*@k-me.com> wrote in message
news:Xl*****************@fe12.atl2.webusenet.com.. .
I can't figue out whats wrong. I am a newbie to sql, however i'm totally lost. i get this error.

"Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
login.asp, line 9"
this is my code.
<!--#include file=connection.asp-->
<%
bGoodAttempt = False
if Request.Form(".submit") = "Login" then
strName = Replace(Request.Form("login"),"'","")
strPass = Request.Form("pass")

sqlStmt = "ValidateLogin @LoginName='" & strName & "'"
oDb.Open strconn
oRs.Open sqlStmt,oDb,adOpenForwardOnly,adLockReadOnly,adCmd Text
if oRs.Eof then
'Failed Login Attempt
strMsg = "Invalid Login Name or Password"
else
if strPass = oRs("Password") then
'Successful Login Attempt
Session("loginid") = oRs("PKID")
Session("name") = oRs("LoginName")
Session("verified") = True
bGoodAttempt = True
else
strMsg = "Invalid Login Name or Password"
end if
end if
oRs.Close
oDb.Close
end if
Set oRs = Nothing
Set oDb = Nothing
if bGoodAttempt then
Response.Redirect "admin.asp"
end if

%>

any help would be greatly appriciated. by the way, it's an ASP webpage.

Jul 20 '05 #2

P: n/a
ron
i'm currently looking thru the links provided, and as suggested, i'm posting
my connection file.

once again,
THANK YOU
this is my connection.asp

<%
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=servername;UID=user;PWD=pass;DATABASE=mydba se "
Set oDb = Server.CreateObject("ADODB.Connection")
Set oRs = Server.CreateObject("ADODB.Recordset")
%>

Jul 20 '05 #3

P: n/a
I ran this code on my test box and it worked without problems. Are you
certain this is the code included in your app? The error message in
your original post refers to the 'Microsoft OLE DB Provider for ODBC
Drivers' but this connection string uses the 'Microsoft OLE DB Provider
for SQL Server' directly. Perhaps you have another connection string in
your code with 'Provider=MSDASQL' that's causing the error.

--
Hope this helps.

Dan Guzman
SQL Server MVP
<ro*@k-me.com> wrote in message
news:HO******************@fe07.atl2.webusenet.com. ..
i'm currently looking thru the links provided, and as suggested, i'm posting my connection file.

once again,
THANK YOU
this is my connection.asp

<%
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=servername;UID=user;PWD=pass;DATABASE=mydba se "
Set oDb = Server.CreateObject("ADODB.Connection")
Set oRs = Server.CreateObject("ADODB.Recordset")
%>

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.