Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help this beginner

Status
Not open for further replies.

theuglytree

Programmer
Oct 26, 2002
1
AU
hi,

i have just entered the world of ASP and need some help... i can get the code (shown below) to work locally running iis but i want it to work on a server... i'm also using an inc file...

what am i doing wrong.... i would be grateful if you could help

thanks...
theuglytree

<%@ Language=VBScript %>
<% Option Explicit %>

<!--#include virtual=&quot;adovbs.inc&quot;-->

<%

Dim objConn, objRS, bolFound, ManagementUserID
Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)

objConn.ConnectionString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & &quot;DBQ=C:\My Websites\db\ManLog.mdb&quot;
objConn.Open
bolFound = False


If (Request.Form(&quot;txtUserID&quot;) <> &quot;&quot;) AND (Request.Form(&quot;txtPassword&quot;) <> &quot;&quot;) Then

Set objRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
objRS.Open &quot;tblLogin&quot;, objConn, adOpenStatic, adLockOptimistic, adCmdTable

ManagementUserID = Request.Form(&quot;txtUserID&quot;)

Do While Not (objRS.EOF OR bolFound)
If (strComp(objRS(&quot;txtUserID&quot;), Request.Form(&quot;txtUserID&quot;), vbTextCompare) = 0) AND (strComp(objRS(&quot;txtPassword&quot;), Request.Form(&quot;txtPassword&quot;), vbTextCompare) = 0) Then
bolFound = True
Else
objRS.MoveNext
End If
Loop

If bolFound Then
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
Response.Cookies(&quot;ManagementUserID&quot;)=ManagementUserID 'set cookie
Response.Redirect (&quot;mngement/m_index.asp&quot;)

End If
End If


%>
 
The DBQ path you are using in the connection string for DBO will be different for your server where you have hosted your site. Try using the
Request.ServerVariables (&quot;APPL_PHYSICAL_PATH&quot;) and then concat the remaining folders to this path to access the database .mdb you are trying to use.

Hope this helps
Hitesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top