Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

Login script for ASP on IIS7/Server 2008 64-bit?

I have a web page that is guarded with a simple login script. the username and login are stored in an access database of the server, and the script calls this through a DSN mapping. This worked great in Windows Server 2003 but I can't get it to work on 2008 64-bit even though I finally figured out how to run ODBC manager in 32-bit mode to add the access databse as a system DSN.

the script has a few different files to it. i have attached the file below that access the DSN and errors out.

Does anyone have a simple script that can do this on server 2008 64-bit?

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=tmlogindb" 

' to prevent SQL and XSS Injection against your database and your site
' updated: January, 7th 2010
Function ProtectSQL(SQLString)
SQLString = Replace(SQLString, "'", "''") ' replace single Quotes with Double Quotes
SQLString = Replace(SQLString, ">", "&gt;") ' replace > with &gt;
SQLString = Replace(SQLString, "<", "&lt;") ' replace < with &lt;
SQLString = Replace(SQLString, "(","&#40;") ' replace ( with &#40;
SQLString = Replace(SQLString, ")","&#41;") ' replace ) with &#41;
SQLString = Trim(SQLString)
ProtectSQL = SQLString
End Function

Open in new window

  • 5
  • 5
2 Solutions
Try something much simpler and get same result:

Function SQLTextV(val)
    SQLTextV = "'" & Replace(val,"'","''") & "'"
End Function

Open in new window

To use it,

Assuming you are updating a record or something:


sql="Update your table " & _
"set & myfieldName=" & SQLTextV(myfieldName)  " & _

You don't say exactly what error you are getting though
ob1_Author Commented:
oh hmm that is a good question. it was a pre-packaged login script that someone else wrote so i am not sure how it exactly works. I will try updating the code and see if that helps. here is the error I am getting:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

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

/downloads/adocon.asp, line 4
ob1_Author Commented:
i still get the same error. i had to run the exe in the file system for the 32-bit versio of ODBC manager since the one in control panel would not give me the option to add an access data source. could this be the problem?
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

yes, if your system is 64bit version, then you would need to run 64bit exe.

Someone had similar problem yesterday.

I will look for the info I sent to him. I don't know if it worked for him though since I don't think I got any feedback.
Check this thread out.

Are you still using Access 2003?

ob1_Author Commented:
the only problem is that the ms access driver does not seem to be available in the 64 bit version. i have googled far and wide for that fix and it does not seem to be available. perhaps i have missed something.
ob1_Author Commented:
ok thanks i will check out the thread and let you know.
Another thing you could try is to enable 32bit aplication to True.

This way, even though you are running 64bit version, it will allow you to run your on 32bit mode.

See this link on how to do it:

ob1_Author Commented:
that was it thank -  i had to create a new app pool and force into 32 bit mode so i could use the 32 bit version of the drivers.

through the other link i found information for downloading 64 bit versions of the access drivers through Office 2010 - this also would have bit an option except there is an app on the server incompatible with Office 2010 64 bit.

thanks for the help!!!!!
Grea, congrats.

Thanks a lot for the points and grade.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now