Help with SQL remote conneciton

T

Tony M

vs 2005 - vb .net (desktop app) - XP Pro

Trying to manipulate data form a desktop app. to a remote hosted website?
Just trying to connect for now. Anyone know what I can change to make
connection?
xxxxxx, yyyyyy and DB are substituted for real values.
Below is the code:

Imports Microsoft.SqlServer
Imports System.Data.Sql
Imports System.Data.SqlClient
Dim Con
Dim Sql As String
Sql = "Server=67.19.23.66;Database=dialer;Uid=xxxxxx;Pwd=yyyyyy;"
Con = New SqlConnection(Sql)
Try
Con.Open()
Catch ex As Exception
TextBox1.Text = ex.ToString
End Try

Below is error message:
System.Data.SqlClient.SqlException: Cannot open database requested in login
'DB'. Login fails.
Login failed for user 'xxxxxx'.
at
Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method
TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at
Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container
BaseReference, String MethodName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags
InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean
IgnoreReturn)
at DialerTest.frmDialerMain.btnCreateDB_Click(Object sender, EventArgs e)
in C:\DialerTestFolder\DialerTestVB\DialerTest\Form1.vb:line 17


Thank You
 
M

Mr. Arnold

Tony M said:
vs 2005 - vb .net (desktop app) - XP Pro

Trying to manipulate data form a desktop app. to a remote hosted website?
Just trying to connect for now. Anyone know what I can change to make
connection?

1) Either the user-id and or psw for the database that you're trying to log
in with is invalid.

2) That IP that is being pointed to 67.19.23.66 is a Web server IP and is
not pointing to an IP that's hosting SQL Server, which I don't see how any
Web site is going to allow you to access SQL server like that, sending an
unprotected text connection string over the Internet with User-id and psw
showing that can be spoofed by a hacker.

I don't see how any Web site is going to be exposing SQL Server to the
Internet so that you can connect to it remotely, in the manner that you are
doing.

However, you could be trying to do this on a LAN behind a firewall.
 
T

Tony M

Haven't spoken to my website provider yet, but what other options do I have?
If I can't communicate with my website via SQL, How else can I do this from
a remote desktop solution?

Thanks for your advice
 
J

Jason Keats

Tony said:
Haven't spoken to my website provider yet, but what other options do I have?
If I can't communicate with my website via SQL, How else can I do this from
a remote desktop solution?

Research ".NET Web Service".
 
M

Mr. Arnold

Tony M said:
Haven't spoken to my website provider yet, but what other options do I
have?
If I can't communicate with my website via SQL, How else can I do this
from a remote desktop solution?

Thanks for your advice

Normally, your Web services provider would need to provide a Web Service for
you with your Desktop solution being the Web service client. Your program
as a Web service client would make contact with the Web service at the Web
site/Web server. The Web Service would do the accessing of SQL server,
because the client issued commands to the Web service to access SQL server
on the Web site's LAN, and the Web service gives information back to the
client, just like a Web browser and a Web application on a Web site/Web
server communicate with each other.

You need to talk to your Web site provider asto the best way to do that and
what you'll need to do on your end, if the Web site as a Web service in
place.
 
C

Cor Ligthert[MVP]

Tony,

Have a look at these,

http://www.connectionstrings.com/?carrier=sqlserver

As the one you have choosen does not work, then contact your provider.

The security of an SQL server can be very fine tuned. Be aware that the SQL
server is created to act on Internet, so the Administrator can have set his
security accoording that.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top