Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Connection String for Connecting to SQL Server over the Internet Posted by luckyumer on 11 Feb 2006 at 2:23 AM
Hi Everyone,
I am new in SQL, I use the following connection String for connecting to SQL server on a local or network PC.

Dim Conn as New ADODB.Connection
Conn.ConnectionString "PROVIDER=SQLOLEDB;DATA SOURCE=(local);UID=MyUserName;PWD=Secret;DATABASE=MyDatabaseName"
Conn.Open

But I want to connect to a SQL Server over the internet
I have changed the DATA SOURCE to the web address but that's
not working.

PLEASE TELL ME THE CONNECTION STRING FOR CONNECTING
VB6 TO A SQL SERVER RUNNING ON THE INTERNET
FOR EXAMPLE TO CONNECT MY VB6 APPLICATION TO
A DATABASE ON WWW.FREESQL.ORG

Thanks
Report
Re: Connection String for Connecting to SQL Server over the Internet Posted by DrMarten on 11 Feb 2006 at 4:27 AM
: Hi Everyone,
: I am new in SQL, I use the following connection String for connecting to SQL server on a local or network PC.
:
: Dim Conn as New ADODB.Connection
: Conn.ConnectionString "PROVIDER=SQLOLEDB;DATA SOURCE=(local);UID=MyUserName;PWD=Secret;DATABASE=MyDatabaseName"
: Conn.Open
:
: But I want to connect to a SQL Server over the internet
: I have changed the DATA SOURCE to the web address but that's
: not working.
:
: PLEASE TELL ME THE CONNECTION STRING FOR CONNECTING
: VB6 TO A SQL SERVER RUNNING ON THE INTERNET
: FOR EXAMPLE TO CONNECT MY VB6 APPLICATION TO
: A DATABASE ON WWW.FREESQL.ORG
:
: Thanks


Try

Conn.ConnectionString "PROVIDER=SQLOLEDB;DATA SOURCE=http://www.freesql.org;UID=MyUserName;PWD=Secret;DATABASE=MyDatabaseName"

Please note i have put the full URL or link address in for

www.freesql.org

I believe you would need the http:// bit in too.
In the same way it is needed in HTML or XHTML.

By the way i'm guessing as i've not done SQL stuff in VB yet.
No harm giving it a try though eh?


Regards,

Dr M

Report
Re: Connection String for Connecting to SQL Server over the Internet Posted by luckyumer on 13 Feb 2006 at 3:42 AM
thanks doctor but i've tried it before you said... but that's not working ha ha ha

it should work but it do not
Umer Saleem
Lahore - Pakistan
luckyumer@yahoo.com
Mob: 0092 321 4257504




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.