|
-
Jan 8th, 2001, 04:11 PM
#1
Thread Starter
New Member
I'm a newbie so sorry if this is simple...
I'm creating a simple online shopping site...
to connect to the database I have the lines
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source='store.mdb'"
rs.Open strSQL,cn
rs.MoveFirst
when moved to a sever, the database i want to point to is at http://merlin/project2/store.mdb. I've tried replacing store.mdb with this path but i get the error messge 'C:\WINDOWS\Desktop\http:\\merlin\project2\onlinestore.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Any ideas would be greatly appreciated
-
Jan 8th, 2001, 04:13 PM
#2
Monday Morning Lunatic
You need to reference the database using the path it's at on the server.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 8th, 2001, 04:18 PM
#3
Thread Starter
New Member
that is the path where its stored on the server....isnt it?
-
Jan 8th, 2001, 04:21 PM
#4
Monday Morning Lunatic
Yep. Such as c:\websites\project2\data.mdb.
One suggestion - keep the database away from any external access (don't have it under a web-shared folder).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 8th, 2001, 04:40 PM
#5
Thread Starter
New Member
Sorry to keep on but....!!
it will be stored on the network server - merlin, in a directory off the root called Project2.
It needs to be accessed across a LAN so it will not be stored on a C drive.
It works fine if i move it around my drive C but when its uploaded to the server and I change the data source command, it doesnt like it!!
-
Jan 8th, 2001, 04:55 PM
#6
Monday Morning Lunatic
Think of it from the ASP's point of view. What is the filename as it sees it?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 8th, 2001, 04:56 PM
#7
You should create DSN.
Go to control panel/ODBC data services/create DSN.
-
Jan 8th, 2001, 05:15 PM
#8
Thread Starter
New Member
It works fine on a standalone PC with PWS installed - its when i have to copy it to the LAN (and therefore change the path of the data source).
Every time i change the path to the new path on the LAN it complains.....I'm not sure if theres any way I can change the syntax because by default, on the LAN, it always looks in a default dir..no matter what path I change it to - it just adds it onto the end of this default path c:\winnt
This helpfull?! I'm desperate!
-
Jan 9th, 2001, 06:21 AM
#9
Member
Use Server Path
You must use the Full path to your database on a server if you do not have a DSN. Like:
Source=Server.MapPath("/folder1/folder2/yourdata.mdb")
The folders must go back to the root, just ask the properties of the database on the server and you should see the full path to the root. Use that.
If you use the database connection in an Included file, don't call the file *.inc but *.asp. Is someone knows the *.inc location he can download the inc file and he knows your database location. *.asp can't be downloaded.
A mind is like a parachute, it has to open to let it work
www.2beesoft.com for Icon Manager with over 20.000 free icons
VB6 Ent. SP4, ASP, W2000/W98
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|