Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
So confused! ASP trying to access a local database.
Old 10-30-2006, 05:28 PM So confused! ASP trying to access a local database.
Novice Talker

Posts: 14
Trades: 0
Hello everyone, does anyone have an idea why when I try to exectue this code:
<%
' Declare variables
Dim cnnPasswordTest

' Create ADO Connection object
Set cnnPasswordTest = Server.CreateObject("ADODB.Connection")

cnnPasswordTest.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=contact.mdb;Jet OLEDB: Database Password=dbpass;"

'Receiving values from Form, assign the values entered to variables
Name = Request.Form("Name")
Email = Request.Form("Email")
Company = Request.Form("Company")
Phone = Request.Form("Phone")

'declare SQL statement that will query the database
sSQL = "INSERT into contact_tbl (Name, Email, Company, Phone) values ('" & _
Name & "', '" & Email & "', '" & Company & "', '" & Phone & "')"

connection.execute(sSQL)

response.write "The form information was inserted successfully."

cnnPasswordTest.Close
Set cnnPasswordTest = Nothing
%>

I get this error:
Microsoft JET Database Engine error '80004005'
Could not find file 'C:\winnt\system32\contact.mdb'.
/auetest/inforeq.asp, line 12


Does anyone know why it is trying to search the local computer, rather than the server that the file is on?


Sorry if I am an idiot. It happens.


Thanks,
Alex

Last edited by ucmeicu; 10-30-2006 at 05:29 PM..
ucmeicu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-30-2006, 07:23 PM Re: So confused! ASP trying to access a local database.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You don't tell it where the file is.

use data source=" & server.mappath("contact.mdb") & "; ....
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-31-2006, 10:13 AM Re: So confused! ASP trying to access a local database.
Novice Talker

Posts: 14
Trades: 0
Thanks alot man!
That did the trick.

Alex
ucmeicu is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to So confused! ASP trying to access a local database.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12935 seconds with 12 queries