AllExperts > Experts 
Search      

Active Server Pages Programming (ASP)

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Active Server Pages Programming (ASP) Answers
Question Library

Ask a question about Active Server Pages Programming (ASP)
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Srini Nagarajan
Expertise
I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience
Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.
 
   

You are here:  Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > Error on database connections

Topic: Active Server Pages Programming (ASP)



Expert: Srini Nagarajan
Date: 11/10/2005
Subject: Error on database connections

Question
Hi Mr.Srini,

I am currently working on our companies website. I have included a form to collect user's data and store it in the database. For connecting I created a folder and stored the database and a file dsn in that folder. Now the code for accessing the database is in another folder. With this scenario its working on my local host. Now when I uploaded this code on to the web server its giving me this following error:

'Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x4a8 Thread 0xb3c DBC 0x20c7e6c Jet'.

/xyz.com/RegistrationForm/Register_Fields.asp, line 17'

I dont understand why is this error coming when the same code i used on my local machine its working fine.

He is the file dsn I am using:

'[ODBC]
DRIVER=Driver do Microsoft Access (*.mdb)
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=MS Access
DriverId=25
DefaultDir=\xyz.com\Databases
DBQ=\xyz.com\Databases\uniplus_pdf.mdb'

And my connection string is something like this:

'Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Mode = 3 ' 3 = adModeReadWrite
MyConn.Open "FILEDSN=\xyz.com\Databases\uniplusdsn.dsn"


And finally the query is like this,

'SQL_query = "INSERT INTO pdfdownload_data"
   SQL_query = SQL_query & "(first_name,last_name,company,email,phone,address,city,state_var,zip,country,"
  SQL_query = SQL_query & "lead_source,others,timeframe,pdf_file,date_field)"
   SQL_query = SQL_query & "VALUES ('"&first_name&"','"&last_name&"','"&company&"','"&email&"','"&phone&"','"&address&"',"
  SQL_query = SQL_query & "'"&city&"','"&state_var&"','"&zip&"','"&country&"','"&lead_source&"','"&others&"',"
   SQL_query = SQL_query & "'"&timeframe&"','"&pdf_file&"',"&CurrentDate&")"
  'Response.write "query" & SQL_query
  MyConn.Execute(SQL_query)'

Please help me where I have gone wrong and what I should be doing to get this working.

Thanks a lot for you time,
Nitu


Answer
Hi

Don't use ODBC driver... it need right permissions on the files

use JET database here is the sample connection string

------------------------
......
svrpath = server.MapPath("/")
constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & svrpath & "\database\db.mdb;Persist Security Info=False"

Set ConDb1=Server.CreateObject("ADODB.Connection")
ConDb1.Open conStr
......

Happy Programming!

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.