Reply
Need help with my DB
Old 01-07-2008, 05:51 PM Need help with my DB
Junior Talker

Posts: 3
Name: Dean Dounev
Location: Ottawa, Ontario
Hi,
I'm new at this and need some help. Trying to build a simple DB for my daughter's club. Created an account with Godaddy.
Here is my problem: Everything works until I hit the final "Submit" and the following shows on my screen:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
General error: Invalid file dsn ''
/Fencing/exoadd.asp, line 15

Here is my code:
<%
Dim adoCon
Dim sql
Dim connectstr, sDSNDir
Dim dsn_name
dsn_name = "access_fencing.dsn"
sDSNDir = Server.MapPath("_dsn")
connectstr = "filedsn=" & sDSNDir & "/" & dsn_name
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open connectstr

Have a DSN file named access_fencing.dsn
DB name is fencing.mdb in a folder named access_db
The rest of my files are in folder named Fencing

What am I doing wrong?

Thank you in advance.
newatthis is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-09-2008, 03:59 PM Re: Need help with my DB
chrishirst's Avatar
Super Moderator

Posts: 11,452
Location: Blackpool. UK
is the file in a folder called "_dsn" within the site folders?

the slash should be the opposite way
Code:
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
as this is a physical path.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-10-2008, 09:29 PM Re: Need help with my DB
Junior Talker

Posts: 3
Name: Dean Dounev
Location: Ottawa, Ontario
I don't have a folder called _dsn. Here is the structure:
Folder - Root
Folder - access_db containing file "fencing.mdb"
Folder - Fencing containing files: "exo_confirm.asp", "exoadd.asp" and "exoform.htm"

Tried with the slash in the oposite way and got the same error message.

Last edited by newatthis : 01-10-2008 at 09:31 PM.
newatthis is offline
Reply With Quote
View Public Profile
 
Old 01-11-2008, 03:16 AM Re: Need help with my DB
chrishirst's Avatar
Super Moderator

Posts: 11,452
Location: Blackpool. UK
Quote:
I don't have a folder called _dsn
this code;
Code:
sDSNDir = Server.MapPath("_dsn")
connectstr = "filedsn=" & sDSNDir & "/" & dsn_name
is telling the server to find a folder called "_dsn" and look for the DSN file in it.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-16-2008, 02:42 PM Re: Need help with my DB
Skilled Talker

Posts: 97
Name: Ganesh
Dean,

I attempted another way based on your posts.

Back up your existing file. Use the below code instead of what you provided on the first post.

Code:
<%
Dim adoCon 
Dim sql
Dim connectstr, sDSNDir
connectstr="Driver={Microsoft Access Driver(*.mdb)};DBQ=" & Server.MapPath("/access_db/fencing.mdb")
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open connectstr
%>
Hope this helps . Good Luck!
__________________
Gather. Search. Compare. Save on Hotel and Flight Prices @ www.vtrip.info

Last edited by sri_gan : 01-16-2008 at 02:43 PM.
sri_gan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help with my DB
 

Thread Tools

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

vB 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.13482 seconds with 13 queries