Connection String DSN-less

This is a discussion on "Connection String DSN-less" within the Classic ASP section. This forum, and the thread "Connection String DSN-less are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 25th, 2003, 11:46
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Connection String DSN-less

Hi, I need quite a lot of help here. Hope someone replies..

I registered an hour ago at www.aspfreeserver.com. My site directory is located at www.aspfreeserver.com/gwx/

The database is located at www.aspfreeserver.com/gwx/db/contact.mdb

The option used in 'Custom Connection String" in dreamweaver is Connection Name : dbConn
Connection String : ConStr = "DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & server.MapPath("../") & "\db\contact.mdb"

here is some additional hierachy information if you need it :
www.aspfreeserver.com/gwx/www/ <--- public views this
www.aspfreeserver.com/gwx/ <--- my folder
www.aspfreeserver.com/gwx/db/ <--- My database folder where contact.mdb resides

The script ( contact.asp ) is to run at www.aspfreeserver.com/gwx/www/

The prob. is that dreamweaver starts uploading weird scripts like adojavas.inc, mmhttpdb.js and all that. What turns out in the end is an error message when testing my connection...

Any chance of 'decrypting' this alien message? I'm dead confused.:sad: Would gladly appreciate anyone's help!

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary(volatile) Jet DSN for process 0x474 Thread 0x7aoDBC 0xe79f024 Jet'.

[Microsoft][ODBC Driver Manager]Driver's SQLSetConnectAttr Failed

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary(volatile) Jet DSN for process 0x474 Thread 0x7aoDBC 0xe79f024 Jet'.

[Microsoft][ODBC Microsoft Access Driver]'[unknown]' is not a valid path. Make sure that the path name is spelled corretly and that you are connected to the server on which the file resides.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Nov 25th, 2003, 17:45
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Basically the path in your connection string is wrong and all those funky errors just mean it can't find the file.

Try:
ConStr = "DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & server.MapPath("../db/contact.mdb")
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 25th, 2003, 18:23
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,193
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Hi!

Maybe there is a chance your sever does not like parent paths where they walk you outside of the public area, in which case use this:-
Code: Select all
Path = lcase(Server.mappath("/"))
Path = replace(path,"\www\","")
Path = Path & "\db\contact.mdb"
Connection String : ConStr = "DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & Path
Hope this helps.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 26th, 2003, 00:35
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Catalyst, your string doesn't work either...
( Yours works only if the database is /gwx/www/db/contact.mdb
and anything in www is read-only and so any code will return with an error )( my contact.asp page is at /gwx/www/ )

Rob, how do I input your code

Path = lcase(Server.mappath("/"))
Path = replace(path,"\www\","")
Path = Path & "\db\contact.mdb"
Connection String : ConStr = "DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=" & Path

into Dreamweaver's Databases tab under the Application area ( Custom Connection String )? This is my first time using Dreamweaver's Application/Databases features... plz explain in detail. Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Nov 26th, 2003, 01:12
Junior Member
Join Date: Nov 2003
Location: United Kingdom
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
You will probably notice that DW has created a folder called connections and in there will be a .asp file that is included by other pages on your site.

You can manually open this file and type in your connection string.

This is especially useful for testing, as it means you do not have to have the same directory structure on your local machine as on the web server.

Be careful about with the code that Rob gave you though, because I think DW may have a problem understanding that on your local machine and will not allow you to insert recordsets etc.

Should be fine on the proper web server though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Nov 26th, 2003, 02:20
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
You mean that a quick remedy is to do everything on my local machine, including testing, and then after the code is ok and I want to put it live, I shoudl exit dreamweaver and open an ftp client.

I should then go to the local Inetpub folder ( where my site is stored locally ) and then manually edit dbConn.asp. After editing and changing to Rob's code, I would upload it using a non-dw ftp client?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Nov 26th, 2003, 02:56
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
HELP!!!

that doesn't work either. Worked up a HTTP 500 internal server error!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Nov 26th, 2003, 05:27
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Actually, mine should work ok. The ../ takes it from gxw/www into gxw/ (../ move you up one level) then the /db drops it down into the db folder. Without the ../ you would be right that it would try gxw/www/db...

I don't know if you tried it and it doesn't work or just looked a the code. If it actually doesn't work then there's something else going on like Rob mentioned about not allowing parent paths outside the public folder, though I've never run into that.

Either way, make you local folder structure match the one on your server and you should be able to work your problems out locally where you can see the specific errors instead of the generic 500 the host gives you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Nov 26th, 2003, 05:33
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
I have IIS installed and locally it works fine ... no problems @ all but it only occurs on the server...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Nov 26th, 2003, 07:24
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Is this the 500 error you're talking about now? The most common difference between local and remote servers is having different permissions set. Is your page just reading from the db or is it inserting/updating?

Also, you could add ON ERROR RESUME NEXT and add a error reporting function to the bottom of your page that will supply you with more detailed information on what's causing your error.

Something like:
Code: Select all
If Err.Number <> 0 Then
     Response.Write(Err.Description)
     Err.Clear
end if
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Nov 26th, 2003, 07:49
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
I just want everyone to know.. GWX03 is doing this for me. Isn't he great!!! Now he's trying to run it off of my server so it wont be on a local server anymore. Just wanted to point that out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Nov 26th, 2003, 12:07
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
I currently can't do nothing cause my server is experiencing downtime. Rob, does your code require a declaration of a variable? ( declare/dim path as variable_string? )

Maybe that caused the error...

Even if Rob's code works, I can't do stuff like add recordsets, add record and other cool server behaviors! and all that from Dreamweaver and would have no choice but to divulge myself again in tons of ASP tutorials and coding and scripts!

You may be wondering why am I making afuss out of this server behavior thing instead of coding all myself. That's because it really cuts down development time, and doesn't force me to fill myself full of code. Well, what I need is just to retrieve some info from a database, write records and all that, not those ultra-complicated stuff like creating a webforum or discussion board!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
connection, string, dsnless

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Connection string for password protected databases alexgeek Classic ASP 6 Oct 31st, 2007 15:59
MySQL Connection String Info Monie Classic ASP 9 Oct 24th, 2007 01:48
ODBC connection go4kpo PHP Forum 2 Jul 10th, 2007 14:20
PHP n MySQL connection uddin PHP Forum 1 Apr 18th, 2007 06:41
dns less connection String djaccess Classic ASP 7 Oct 5th, 2003 14:34


All times are GMT. The time now is 01:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved