Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 7th, 2003, 08:22 AM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
Connectecting to a DB on an external server

hello, I wanted to know if it is possible to connect to a DB that is not located okn my server.

I want to build a VB program that will connect to a DB (using DAO) on an Internet Server, Is it possible? will I have to use the winsock.dll?


any Ideas will be helpful, thanks,

Ben.

Reply With Quote
  #2  
Old October 7th, 2003, 08:52 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 27 m 47 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Either the machine that the application is going to be run on has to support (in odbc) a connection to the database or you will have to supply a driver so that you can connect.
It is easiest done via odbc to set up a dsn to the database (which typically isn't on your machine) which also makes connecting a lot easier.
Also, I would recommend ADO instead of DAO since it is better maintained then the older DAO methods.

Reply With Quote
  #3  
Old October 7th, 2003, 12:26 PM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
I only said DAO cause I thaught VB suports only DAO and not ADO, but I too prefer ADO...


about the connection to the DB, I realy didn't understand you, maybe U didn't understood me, I'll explain again:

I want to make a VB program on my computer (or any other computer) that I'll run and it will be able to connect to my DB that's on a web server (example: http:\\www.bla.org.il\db\db1.mdb OR Ip:192.168.0.1\db\db1.mdb(not this IP, but an IP)).

I want to be able to change that DB and also read from it, I have the FTP username and password, now, how do I do it?


If you could me a little bit specifeic, thanks,

Ben.

Reply With Quote
  #4  
Old October 7th, 2003, 11:54 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 27 m 47 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
ok, let me try to explain this a little better.
A typical database is not on the computer that the accessing application is run from. That is one of the reasons odbc is there. ODBC allows you to set up an ip/port/db driver combination in many instances to connect to the database.

Now, in your case, your dealing with an access file through ftp. This doesn't really fit into the above scenario, and although I can think of a solution for your problem, it isn't a good one: the application downloads the database and uses it on the local machine, then when it is done, it ftps the altered version back to the server. This isn't a good scenario because if more than one application will use this .mdb file, then your data has severe possibilties for bad data, or incorrect data to be used, or for data to be lost, etc...

Reply With Quote
  #5  
Old October 8th, 2003, 01:47 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,826 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 19 h 46 m 30 sec
Reputation Power: 765
The only way I know to connect to a remotely hosted access file is with the MSRemote provider. However, it's not readily available from web hosts, I know it's not available on my hosted sites.

http://support.microsoft.com/defaul...&NoWebContent=1

Reply With Quote
  #6  
Old October 8th, 2003, 07:55 AM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
thanks for the answers, but Onslaught, if you say ODBC is there to connect to the DB with an IP then whats the problem? Can't I use it?
Or is it available in ODBC only with the MSRemote?


thanks anyway, and Doug, the MSRemote provider needs to be installed on both the server and the client's computer, or only on the server?

thanks, ben.

Reply With Quote
  #7  
Old October 8th, 2003, 08:28 AM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
OK guys, I found a page talking about exactly this, take a look:

http://www.able-consulting.com/MDAC...DriverForAccess

In the end of that there is a prase:

If MDB is located on a remote machine

- Or use an XML Web Service via SOAP Toolkit or ASP.NET
- Or upgrade to SQL Server and use an IP connection string
- Or use an ADO URL with a remote ASP web page
- Or use a MS Remote or RDS connection string


now, I wanted to ask, how can I know if MS remote or RDS is installed on my server?

Reply With Quote
  #8  
Old October 8th, 2003, 09:57 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,826 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 19 h 46 m 30 sec
Reputation Power: 765
Quote:
now, I wanted to ask, how can I know if MS remote or RDS is installed on my server?

Ask the server admin. If it's a commercial ISP I think your odds are not good of finding the MS Remote provider available

If I had to use a remote Access DB I'd probably throw together some asp-based wrapper to communicate with the remote db rather than trying to get to it directly.

Reply With Quote
  #9  
Old October 8th, 2003, 10:43 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
I think it is a best way that use web access DB.Like asp access sql or MS access,PHP access MYsql...

Reply With Quote
  #10  
Old October 8th, 2003, 12:56 PM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
by web access DB, you meen direct access, and not remote, or what?

and "asp-based wrapper" do U meen ADO URL? - http://www.able-consulting.com/MDAC...doUrlConnection

Reply With Quote
  #11  
Old October 8th, 2003, 11:24 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
I mean the URL is the web url like asp page,not the ADO url..U can use asp to access DB directly.

Reply With Quote
  #12  
Old October 9th, 2003, 02:38 AM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
I know I can connect to the DB through a asp page thats on my server, and I allready do that, but I also want to make a program that will access the DB remotly...

Reply With Quote
  #13  
Old October 9th, 2003, 03:14 AM
Reason Reason is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Reason User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

Yeah, I want to do something to do like that too, I have a DB on a server, and those data is imported into Excel via VBA. So now I want to export specific parts of those excel files so I can view them in VB or so... you know how to do this?

Good luck to us all

?

Reply With Quote
  #14  
Old October 9th, 2003, 10:09 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig

Reply With Quote
  #15  
Old October 16th, 2003, 01:56 AM
Reason Reason is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Reason User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I`ve made it myself easy,
I`ve given the regions i want to partionally export a name, then recorded the exporting with one region, and then adjusting it, and copying it for the other regions... this solves my problem. If you still have some, post!

greetz...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Connectecting to a DB on an external server