This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / Help!! I programed asp pages involving transaction with ACCESS. They work properly on local machine. Now I upload the databse to server,but I don't know how to modify the code to open the connection with the database. I tried DSN and DSN-less connection command, but some information show as following:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I thnk the problem lies in how to refer to the location of the databse on the server.Anybody can give me some advice? Thanks a lot. Waiting for your reply.
-waokool(waokool);
2002-9-2
{418}
(#725507@0)
-
put your asp code and DSN configure here. let me study.
-jqian(Q_Q);
2002-9-2
(#725510@0)
-
Thank you. see inside.Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={MS Access (*.mdb)};DBQ=http://ftp.xxxx.com/CPSP/data/xxxinfo.mdb"
-waokool(waokool);
2002-9-2
{151}
(#725679@0)
-
不可能实现。访问ACCESS数据库需要文件读写权限。
-miketany(MIKE老狼);
2002-9-2
(#725693@0)
-
Ok, I modified like this:
conn.open "DRIVER={MS Access (*.mdb)};DBQ=http://ftp.xxx.com/CPSP/data/cxxxxfo.mdb;"&_
"Uid=xxxx; Pwd=vvvvvv"
Still has the same result
-waokool(waokool);
2002-9-2
(#725707@0)
-
You can create a ODBC in your local machine, and this ODBC is "link database" pointed to your server IP and server database.Then you can access this database just like it is on the local.
-ivy_sh(Ivy_sh);
2002-9-2
(#725806@0)
-
Thanks. But I don't understand. I am a beginner. I created ODBC when I create database on local machine,and all the relative function works well through PWS. So the only problem is how to refer to the database that i uploaded. Could u explain a liitle bit more? Thank you again.
-waokool(waokool);
2002-9-3
{174}
(#725866@0)
-
Sorry, It's my misunderstand for ACCESS.I use different database that can provide "client DSN setup" on ODBC. I checked ACCESS,It look like no such feature that. But I want to say there is no easy way to access database on Server. Actualy I use JDBC to connect remote database. Sorry, in this case( for your ASP) I am helpless.
-ivy_sh(Ivy_sh);
2002-9-3
{289}
(#726317@0)
-
我记得是需要提供access文件的绝对地址(即://server name/..../file name),如果服务器不是自己的,那要问web host了。
-guestagain(guest again);
2002-9-3
(#726324@0)
-
Sigh, I am frustrated. I am communicating with web host. They sent me some very general help topics. wait to see. Thank you anyway.
-waokool(waokool);
2002-9-3
(#726336@0)
-
你有没有问你的web host支持不支持access,有些是不支持的。如果支持,就问他们怎么设置好了。
-guestagain(guest again);
2002-9-3
(#726339@0)
-
The web host supports Access. I am not an IT guy any way. Thay's the reason why I didn't use SQL Server.Totally confused now. The support staff only emailed me one page of very general instruction. i think if the pages involving ACCESS can work properly through PWS, my code basically is OK. Just need to modify the connection part. Am I right?
-waokool(waokool);
2002-9-3
{243}
(#726570@0)
-
应该主要是conncetion string和server端的设置的问题。
-guestagain(guest again);
2002-9-3
(#726582@0)
-
microsoft建议在asp中,一切使用ADO同数据库的连接工作都由OLEDB来做。见内:Set Con=Server.CreateObject("ADODB.Connection")
Con.open "provider=microsoft.jet.oledb.4.0; data source=abcd"
其中abcd是data source的link路径,如果在同一台机器上,就指定一个.mdb文件。若在不同机器上,abcd为创建的data link名称,为.UDL文件。
-jqian(Q_Q);
2002-9-3
{244}
(#726385@0)
-
问题是他用的是web host的服务器,建UDL恐怕要通过web host那边了?
-guestagain(guest again);
2002-9-3
(#726390@0)
-
那就完蛋了,没戏了,想都别想了。为什么要用access,用SQL Server就没问题了,不需要建立任何link,直接在程序里面open OLEDB。
-jqian(Q_Q);
2002-9-3
(#726400@0)