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.
|
|
|
|
|
![]() |
||
Connection String DSN-less
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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. |
|
|
|
#2
|
|||
|
|||
|
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") |
|
#3
|
||||
|
||||
|
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:-
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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? |
|
#7
|
|||
|
|||
|
HELP!!!
that doesn't work either. Worked up a HTTP 500 internal server error!! |
|
#8
|
|||
|
|||
|
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. |
|
#9
|
|||
|
|||
|
I have IIS installed and locally it works fine ... no problems @ all
|
|
#10
|
|||
|
|||
|
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:
|
|
#11
|
|||
|
|||
|
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.
|
|
#12
|
|||
|
|||
|
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. |
![]() |
| Tags |
| connection, string, dsnless |
| Thread Tools | |
|
|
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 |