TheWizardofInt Posted February 1, 2004 Posted February 1, 2004 On the LAN, I can make the SQL Server database=192.168.0.5, which is where IIS is running and the SQL Server is running This doesn't work over the Internet, when I change the IP address to its remove IP. It is making a connection to the Server, but not to the SQL server (invalid database name or incorrect connection error). Am I out to lunch thinking I can do this, or is there a trick to it I am missing? Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 1, 2004 Moderators Posted February 1, 2004 Where is the application being hosted and where is SQL server hosted? Is one local and the other on a hosted server? Quote Visit...Bassic Software
TheWizardofInt Posted February 1, 2004 Author Posted February 1, 2004 Yes, one is local (running on your PC) and SQL is running on a Windows Advanced Server with a static IP, where IIS is running and the SQL database is located. Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 1, 2004 Moderators Posted February 1, 2004 What does your connection string look like (Place *** over you username and password) Is this an intranet setup or will it serve the public? Quote Visit...Bassic Software
TheWizardofInt Posted February 1, 2004 Author Posted February 1, 2004 sServer = 1.2.3.4 sqlConn = New SqlClient.SqlConnection("Server=" & sServer & ";Database=" & _ sDir & ";uid=" & sGlobSQLUser & ";pwd=" & sGlobSQLPass & ";") dim dt as New DataTable sqlDA = New SqlClient.SqlDataAdapter(sSQL, sqlConn) Try sqlDA.Fill(dt) Catch ex1 As Exception sannounce = ex1.Message dt.Dispose() sqlDA.Dispose() sqlConn.Close() sqlConn = Nothing Return False Exit Function End Try Have also tried 1.2.3.4/ServerName This isn't intranet, this is public Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 1, 2004 Moderators Posted February 1, 2004 Have you opened the Client Utility Tool | SQL Server | Program Files | then ADD a new location ? Quote Visit...Bassic Software
Moderators Robby Posted February 1, 2004 Moderators Posted February 1, 2004 Also, once you do so, open Enterprise Manager or Query Analyzer and attempt to connect. Quote Visit...Bassic Software
TheWizardofInt Posted February 1, 2004 Author Posted February 1, 2004 Is this in VS.Net? Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 1, 2004 Moderators Posted February 1, 2004 Have you opened the Client Utility Tool | SQL Server | Program Files | then ADD a new location ? Quote Visit...Bassic Software
TheWizardofInt Posted February 2, 2004 Author Posted February 2, 2004 Tried it - didn't work. As well, I have to be able to set the IP dynamically (at run time, not design time) Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 2, 2004 Moderators Posted February 2, 2004 Leave VS alone for a moment. Are you able to establish a connection using the "Client Utility Tool" and "Enterprise Manager"? Quote Visit...Bassic Software
TheWizardofInt Posted February 2, 2004 Author Posted February 2, 2004 No, I cant. Tried with windows and sql authentication Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 2, 2004 Moderators Posted February 2, 2004 What steps did you take? Quote Visit...Bassic Software
TheWizardofInt Posted February 2, 2004 Author Posted February 2, 2004 I tried to create a new connection using the IP address of the remote server and SQL authentication. This failed, so I tried to use windows authentication, and this also failed. It comes back the same for each: SQL server doesn't exist or incorrect login or password. There is an article on MS that says that this can only be done by creating a DSN, which is what I will probably try next. Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Moderators Robby Posted February 2, 2004 Moderators Posted February 2, 2004 So I can assume that you have yet to try the Client Utility Tool ? Quote Visit...Bassic Software
georgepatotk Posted March 2, 2004 Posted March 2, 2004 TheWizardofInt, might or might not be the problem of network setting. Is your connection to the SQL server been set in the firewall? DMZ or NAT must be set to trasfer SQL packets to you internal SQL server. I'd experienced the same error for my previous project. And NAT had solved my problem. Quote George C.K. Low
TheWizardofInt Posted March 2, 2004 Author Posted March 2, 2004 I was just thinking that yesterday. When you say NAT, what do you mean? I was thinking that I would have to do the connection through a PORT 21 or something like that, and configure the port for two-way transfer Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
georgepatotk Posted March 3, 2004 Posted March 3, 2004 If you are talking about SQL server, the port would be 1433 and 1433. NAT = Network Address Translators. It depends on your firewall whether it supports NAT or DMZ. Some of the firewall support both. But for security purposes, I would suggest NAT rather than DMZ. For what I had done, I just set the firewall to pass all the reeived packets with port 1433 to Internal server(192.168.0.5). And ask the firewall to accept all the packets with 1434 to be sent out. Kindly inform me whather this solve your problem. Hope that I could help Quote George C.K. Low
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.