Subject: Help needed please please
Posted By: PhillipMorris Post Date: 8/21/2003 9:01:09 AM
I am trying to build a project that has access to a database stored in a web server. I uploaded my database in a free hosting site like websamba and i don't know how to access it from my app. I am sure that it could be done using asp code but i am getting mixed up with DSN or DSNless asp code.
Can someone help me please. I am desperate...


Reply By: pgtips Reply Date: 8/21/2003 9:41:55 AM
I just had a look at websamba and I see they offer "Free ODBC System DSN Setup".  So it would seem the easiest way for you is to get a system DSN set up and use that to connect to your db like this:

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=whateverNameItUses"
...


hth
Phil
Reply By: PhillipMorris Reply Date: 9/10/2003 1:00:23 AM
Well, the problem is that I cannot use the DSN setup. The websites don't allow that option...

Thanks anyway...

Reply By: pgtips Reply Date: 9/10/2003 3:15:05 AM
Well then you'll have to use DSN-less connection.  You need to find out the relative path from your asp page to the database and build your connection string accordingly.  You don't say what rdbms it is (Edited - oops just realised this is the Access forum so use the Jet OLEDB driver examples in that link page), but there are examples of them all here: http://www.able-consulting.com/ADO_Conn.htm
Reply By: DaveGerard Reply Date: 9/23/2003 11:39:56 PM
Maybe this can help. Let me know if it does okay or at least comes close.

conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=path\whatever.mdb"
OR better yet
conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../whatever.mdb")

Then set and open your recordset...

set rs = server.createobject("adodb.recordset")
sql = "select * from table"
rs.open sql, conn, 3, 3


NOTE: 3, 3 is write mode for Access I think.





Go to topic 3858

Return to index page 1039
Return to index page 1038
Return to index page 1037
Return to index page 1036
Return to index page 1035
Return to index page 1034
Return to index page 1033
Return to index page 1032
Return to index page 1031
Return to index page 1030