Solved

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

Posted on 2010-11-30
10
395 Views
Last Modified: 2012-05-10
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?


thanks,
bobby
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=tmlogindb" 
objConn.Open


' 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

0
Comment
Question by:ob1_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34238763
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:

Then

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

You don't say exactly what error you are getting though
0
 
LVL 6

Author Comment

by:ob1_
ID: 34239208
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
0
 
LVL 6

Author Comment

by:ob1_
ID: 34239500
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?
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34240028
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.
0
 
LVL 29

Assisted Solution

by:sammySeltzer
sammySeltzer earned 500 total points
ID: 34240041
Check this thread out.

Are you still using Access 2003?

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26644964.html

0
 
LVL 6

Author Comment

by:ob1_
ID: 34240049
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.
0
 
LVL 6

Author Comment

by:ob1_
ID: 34240073
ok thanks i will check out the thread and let you know.
0
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 34241938
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:
http://stackoverflow.com/questions/637326/how-to-guide-for-getting-a-classic-asp-application-working-under-iis-7-0

0
 
LVL 6

Author Closing Comment

by:ob1_
ID: 34395446
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!!!!!
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34396870
Grea, congrats.

Thanks a lot for the points and grade.

--sammy
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question