PDA

Click to See Complete Forum and Search --> : Use an Access DB on the Web with DAO or similar?


Molasar
Jul 10th, 2000, 03:23 PM
I usually use an Access database with VB like this:

Dim ws_WS As Workspace
Dim db_DB As Database
Dim rs_RS As Recordset

Set ws_WS=Workspaces(0)
Set db_DB=ws_WS.OpenDatabase("c:\data.mdb")
Set rs_RS=db_DB.OpenRecordset("Table",dbOpenDynaset)

Something like that...

The question is: Is it possible to open a database resident on a Web server (or web host) in the same manner as I would a local database? That is, without any kind of service running on the host? Something like:

Set db_DB=ws_WS.OpenDatabase("http://whatever.com/data.mdb")

This kind of setup would not need any kind of service running on the host, just like in a local hard disk. Is it possible, and if so, how?

capone
Jul 10th, 2000, 04:12 PM
Take a look at this thread http://forums.vb-world.net/showthread.php?threadid=21195
Mark Sreeves explains it.

Molasar
Jul 10th, 2000, 04:29 PM
Ok, but since the database is in, say: http://whatever.com, I cannot specify that path in the ODBC driver in control panel... what do I do?

capone
Jul 10th, 2000, 04:33 PM
Hmmm.... I don't know, I'm fairly new to ASP. I assume you tried putting the URL in for the path andit didn't work, so I'm stumped.

scottr
Jul 10th, 2000, 08:53 PM
it would be tricky to call it the way you want. Typically you can use an Access Db but you should use ADO and not DAO.

## Open DataBase Connection


set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString

'## Get Totals
set rs1 = Server.CreateObject("ADODB.Recordset")
strSQL = "Select * from Totals"
rs1.open strSQL, my_conn

rs1.Close
set rs1 = nothing

Within connectionstring you could call a dsn such as

connstring="WhateverDSNYouwant"

Molasar
Jul 11th, 2000, 10:27 AM
Ok, but there is still one question:

How do I specify the web path in the ODBC Control Panel icon? It only accepts regular drive or network paths, not "http://" paths...