VB Windows Application and remote Database?

  • Thread starter Thread starter James W. Hall Sr.
  • Start date Start date
J

James W. Hall Sr.

I have a windows application written in VB 6.0 and Microsoft Access. I
have 4 customers using it. One of my customers has set up two offices.
I have a way of putting the Access database on my webserver. Can I
access the Access database from my windows app?

I put a lot of time into this app and would rather add features to it
then rebuild. My customers are very happy with the application. I just
don't have a lot of experience with remote databases. I don't want to
use citrix or set up a vpn. These are small offices.

James W. Hall Sr.
(e-mail address removed)
 
Consider converting to SQL Server. You can buy a SQL Server service from
several different ISPs (about $25/mo). With your data out there your users
can access it from Web apps or Windows apps.

HTH

Wayne
 
I have the service already. my question is, what is the best way to
connect my windows app to the database at my ISP?

James W. Hall Sr.
(e-mail address removed)
 
Just create a normal SQL connection - for example:

Dim cst As String
Set myConn = New ADODB.Connection
cst = "Provider=SQLOLEDB; Data Source = 63.209.100.190; Initial Catalog
= myDB; User ID = myID; Password=myPW"
myConn.Open cst

Wayne
 
Thanks, Wayne.

I'll give it a go. My thoughts were that it was more difficult than
just creating the SQL connection. Thanks again.

James W. Hall Sr.
(e-mail address removed)
 
When I switched to SQL Server I was surprised at how smooth it was. I love
it!

Wayne

p.s. Good luck on your project.
 
Wayne,

I have switched to SQL SERVER. I have a database at my ISP and
they have created a DSN for me called alphadispatch. I'm having trouble
understanding the connection string for "Data Source =" and "Initial
Catalog ="

Stupid question. How does the connection string find the DSN at my
ISP? Remember I am running this from a VB standard exe.

James W. Hall Sr.
(e-mail address removed)
 
I found that trying to get DSNs setup on a service like this was difficult
and/or not supported. I just use a complete connection string in my
application. Such as:

Dim cst As String
Set myConn = New ADODB.Connection
cst = "Provider=SQLOLEDB; Data Source = 63.209.100.190; Initial Catalog
= myDB; User ID = myID; Password=myPW"
myConn.Open cst

Change Data Source to the IP addr or name (e.g. SQLService.com) and then
plug in the name of your DB and the login ID and password.

Wayne
 
Wayne,

I have the connection string setup and I had the service setup a DSN
for me. I am still getting a Run Time Error -2147012867 Internet Client
Error - Cannot Connect to Server.

Am I missing anything? Do I need to load IIS or something? I am
going to contact the ISP this morning.

Using this code:

Dim rsgeneric As Recordset
Dim cnngeneric As Connection
Set cnngeneric = New Connection
cnngeneric.Open "provider=ms remote;" _
& "Remote Provider = MSDataShape;" _
& "Remote Server=http://100.70.160.178;" _
& "Data Source=dispatch;" _
& "User Id=dispatch; Password=test"
' Changed the connection, username and password to test info.
Set rsgeneric = New Recordset
Dim strquery As String
strquery = "select * from sysusers"
rsgeneric.Source = strquery
Set rsgeneric.ActiveConnection = cnngeneric
rsgeneric.Open
Do While rsgeneric.EOF = False
Debug.Print rsgeneric(0)
rsgeneric.MoveNext
Loop
rsgeneric.Close
cnngeneric.Close


James W. Hall Sr.
(e-mail address removed)
 
Back
Top