Discussion:
Can VB6 Connect to an Online Database?
(too old to reply)
Sarah
2004-03-06 04:16:47 UTC
Permalink
Hi,

I'm wondering if there's a way to connect to an online database using
VB 6 so I can query a database on my website.... or does the database
need to be local? Can someone please let me know how this could be
done?

Thanks!

-Sarah
Graham Dobson
2004-03-06 05:39:17 UTC
Permalink
Post by Sarah
I'm wondering if there's a way to connect to an online database using
VB 6 so I can query a database on my website.... or does the database
need to be local? Can someone please let me know how this could be
done?
Hi Sarah,

If the database is SQL Server and you are using ADO and the OLE DB provider
for SQL Server your connection string would look something like this:

"Provider=SQLOLEDB;Data
Source=ns51.zabco.net;Database=db0467;uid=dba0467;pwd=rob8839;"

The data source would be the URL for the server and the database would be
the database name etc. You could then use ADO and VB to return recordsets
from the web based database just as you would any other database. The PC
your application is running on would just need to be connected to the
internet. -- Graham
Sarah
2004-03-06 05:46:25 UTC
Permalink
Thanks for the help Graham...

It's an Access Database unfortunately.. and I've tried putting the
URL in as the data source in the ConnectionString and it gives me a
runtime error saying "Not a Valid File Name"

This is using Adodc and a datagrid...

Any ideas? :)

On Sat, 6 Mar 2004 00:39:17 -0500, "Graham Dobson"
Post by Graham Dobson
Post by Sarah
I'm wondering if there's a way to connect to an online database using
VB 6 so I can query a database on my website.... or does the database
need to be local? Can someone please let me know how this could be
done?
Hi Sarah,
If the database is SQL Server and you are using ADO and the OLE DB provider
"Provider=SQLOLEDB;Data
Source=ns51.zabco.net;Database=db0467;uid=dba0467;pwd=rob8839;"
The data source would be the URL for the server and the database would be
the database name etc. You could then use ADO and VB to return recordsets
from the web based database just as you would any other database. The PC
your application is running on would just need to be connected to the
internet. -- Graham
Graham Dobson
2004-03-06 06:30:33 UTC
Permalink
It's an Access Database unfortunately.. >
This is considered obsolete by Microsoft but I found it in a list compiled
by Carl Prothman:
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb", _
"admin", ""
Graham Dobson
2004-03-06 06:39:42 UTC
Permalink
With respect for intellectual honesty and the hard work of others, the url
for Carl Prothman's extensive list of connection strings is:

http://www.able-consulting.com/ADO_Conn.htm
Jim Carlock
2004-03-06 23:26:23 UTC
Permalink
Hi Sarah.

Can you see the recordset by typing in the following in the
web-browser?

http://www.websitename.com/pathtodata/database.mdb

If you can see it by typing that in, then you might be able to
create a network share to the location which might help.

The problem though, is that when you use http: you are
sending information over port 80 of the TCPIP protocol.

If you can see the database in that manner, and it's on the
internet, it's very likely insecure, because if you can do it,
everyone can do it.

If it's on a local shared drive (intranet), then the easiest way
to accomplish this is to just create a network share to the
database, then use the network share mapping.

If that doesn't work for you, you can create a web page, and
it's quite easy, because Access will do it for you, then you'll
just upload the files to the server along with the webpages.

If the data can be viewed using port 80, you could create
something to parse the page created to extract the data.

Excel can grab data and likes grabbing table data very much.

These are all workarounds, and they'll work.

I've read something about Visual InterDev being able to
supply data, I just didn't finish the reading and never pursued
it.

There are ways to create a data feed through ODBC, but I'm
thinking you'll need to leave a port open on the IIS server and
you'll want to secure the database with passwords and userids.

Hope that helps explain some things. I've only touched on the
explanations, and I don't know everything. Perhaps someone
else can tap in and offer a suggestion.

Sometimes little hints about things helps spark other ideas.

Good luck!
--
Jim Carlock
http://www.microcosmotalk.com/
Post replies to the newsgroup.


"Sarah" <no-spam~***@zhouse.com> wrote in message news:***@4ax.com...
Thanks for the help Graham...

It's an Access Database unfortunately.. and I've tried putting the
URL in as the data source in the ConnectionString and it gives me a
runtime error saying "Not a Valid File Name"

This is using Adodc and a datagrid...

Any ideas? :)

On Sat, 6 Mar 2004 00:39:17 -0500, "Graham Dobson"
Post by Graham Dobson
Post by Sarah
I'm wondering if there's a way to connect to an online database using
VB 6 so I can query a database on my website.... or does the database
need to be local? Can someone please let me know how this could be
done?
Hi Sarah,
If the database is SQL Server and you are using ADO and the OLE DB provider
"Provider=SQLOLEDB;Data
Source=ns51.zabco.net;Database=db0467;uid=dba0467;pwd=rob8839;"
The data source would be the URL for the server and the database would be
the database name etc. You could then use ADO and VB to return recordsets
from the web based database just as you would any other database. The PC
your application is running on would just need to be connected to the
internet. -- Graham
Loading...