|
-
June 11th, 2005, 08:23 PM
#1
Help With Connecting To Remote SQL server
Hey guys/gals
I've been doing a lot of research and cant seem to get this to work, what i want to do is connect say from work through a vb program to an sql database here at home. The code i've found and have not got working so far is
dim SqlCon as SqlConnection = New SqlConnection
SqlCon.ConnectionString = "Data Source = xxx.xxx.xxx.xxx; initial catalog = Attendance; user id = sa; password = mypassword;"
SqlCon.Open()
the error i get is Sql Server does not exists or access is denied
I want to be able to test this at home as i have a wireless network setup so i should be able to hit up the ip assigned to the router to test it out. Also i have opened up the appropriate ports to allow Sql access through the router. Any help would be appreciated.
Update
When i run the program i can see the lights on my router flashingand i can see when my network icon on my laptop is active the one on my desktop is receiving information, after a few seconds i get "SQL server does not exist or access denied"
Thanks,
Josh
Last edited by 1FstZed; June 12th, 2005 at 09:31 AM.
-
June 12th, 2005, 06:15 AM
#2
Re: Connecting To Remote SQL server
-
June 12th, 2005, 09:39 PM
#3
Re: Connecting To Remote SQL server
Are you sure your ISP does not block SQL server port?
Good Luck,
-Cool Bizs
-
June 13th, 2005, 05:52 AM
#4
Re: Connecting To Remote SQL server
I should have thought of that, i'll hit them up and see if they do, and if they do is there any way around it? i have one SQL server(Laptop) running on port 1433 and my desktop is on port 1434(i hope that's an ok port) and i want to connect to my desktop remotely. Also if they dont block the port is there any reason why this would not work? Like i stated before i'm using a router for the network here but i have opened up the port(s) for the SQL server and still nothing.
Thanks,
Josh
Last edited by 1FstZed; June 13th, 2005 at 05:58 AM.
-
June 13th, 2005, 06:14 AM
#5
Re: Connecting To Remote SQL server
A workaround that I could think of is (not sure if this will work w/ SQL server) to redirect an external port to an internal port (IP forwarding). So open up an arbitrary external port number (like 3341) and forward it to your desktop IP address port 1434.
Good Luck,
-Cool Bizs
-
June 13th, 2005, 07:00 AM
#6
Re: Connecting To Remote SQL server
Thanks for the response. I will try that tonight when i get home from work. And i will also call my ISP to see if they block the port if that does not work.
Thanks,
Josh
-
June 13th, 2005, 02:38 PM
#7
Re: Connecting To Remote SQL server
I've tested that workaround and it does work. However, you will need to enabled MIXED user security setting (allow windows and SQL server authentications).
Good Luck,
-Cool Bizs
-
June 13th, 2005, 03:57 PM
#8
Re: Connecting To Remote SQL server
You can change the port you listen to on the SQL server. Then you need to change the registry entry for remote server on your client computer to the correct port.
Nicolas Bohemier
-
June 13th, 2005, 05:54 PM
#9
Re: Connecting To Remote SQL server
Hey guys i'm having a problem gettin this to work, i have my sql server set to mixed mode authentication but i cant seem to connect, coolbiz if you can give me a quick set of setup instructions(what settings to set on my router and such) i'd be grateful. And is it possible to test the vb program from the machine i'm trying to connect to? If anyone is on Messenger feel free to add me [email protected]
Thanks,
Josh
Last edited by 1FstZed; June 13th, 2005 at 05:58 PM.
-
June 14th, 2005, 10:14 PM
#10
Re: Connecting To Remote SQL server
I'd like to say thanks for the help and that i got this working, for some reason when i formatted my computer and reinstalled everything the connection started to work.
Thanks again
Josh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|