Results 1 to 24 of 24

Thread: Connection string error

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Connection string error

    This code working fine with LOCAL IP not with WAN. can anyone help me abouth this.

    Code:
    Dim con As New ADODB.Connection
    conString = "PROVIDER = SQLOLEDB;SERVER=LOCAL IP;UID=XXXX;PWD=XXXX;DATABASE=TESTDB"
    con.ConnectionString = conString
    con.Open
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Of course it won't work with a WAN if you use 'LOCAL IP'. You have to actually use an IP Address...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    yes, i have relpaced with the wan ip but it did not work.

    I have referred with connectionstring.com also.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Well, look at the obvious things first. I hardly think that a SQL database on the WAN or Internet will have a UserName or XXXX or a password of XXXX...

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Connection string error

    Thread moved to Database Development forum

    Assuming you have changed all the values as apt (ie: replaced LOCAL IP/XXXX/XXXX/TESTDB with whatever is right for your situation), what is the actual problem? (if you are getting an error, what is it?)

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    runtime error: - 2147467259 (80004005)
    [DBNETLIB][connectionopen (connect()).] sql server does not exist or access denied.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    That's like attempting to walk thru a brick wall where there is no door. You will get an error...

    All your parameters have to be correct for the database you are connecting too.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    Quote Originally Posted by randem
    That's like attempting to walk thru a brick wall where there is no door. You will get an error...

    All your parameters have to be correct for the database you are connecting too.
    I can connect thorugh LOCAL IP ie 192.168 series(all my parameter is correct). Is this possible to connect with my STATCI IP i just changed the LOCAL IP to STATIC IP????????????
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Well, your Local database is not on the WAN, it's on the LAN... You have to use the correct parameters for the database on the WAN.

  10. #10
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Connection string error

    Quote Originally Posted by cutepraba
    I can connect thorugh LOCAL IP ie 192.168 series(all my parameter is correct). Is this possible to connect with my STATCI IP i just changed the LOCAL IP to STATIC IP????????????
    Are you behind NAT? I believe you need to configure port forwarding when using public IP, otherwise the firewall will block outside request.

  11. #11
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Connect to What???? Doesn't your external database have an IP address or a name that can be resolved to one????

  12. #12
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Connection string error

    @randem

    he want's to connect using public IP. Maybe he's deploying the application outside the network so he'll use public IP. The problem is if he's behind NAT, then it will not allow incoming traffic.

  13. #13
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    That may be so, but the OP hasn't defined exactly what they are doing, where they are running and a host of other thing...

  14. #14
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Connection string error

    Exactly. Let's wait for the OP for a detailed info.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    I am using SQL Enterprise edition V 8.0(OS:win2003) and i am very behind the installation and configuration of SQL server. the system has configured with Direct STATIC IP with DNS and GATEWAY. What do you want me to do to working with WAN? please help.
    I know only vb.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  16. #16
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Connection string error

    Read post #10.

  17. #17
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Matter of fact READ all the post since you last posted!!!!

    You are not helping us help you at all...

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    Can someone post some tutorial for (port forwarding) and source codes for VB.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  19. #19
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Why don't you answer the posted questions first???

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    Quote Originally Posted by randem
    Why don't you answer the posted questions first???
    Hi, Only I need to learn how to working with STATIC IP, in my concern i am not authorized to using my DB in internet. I just want to learn is there any possible to work. And i am very behind NAT concept and routers etc. but i am sure it did not behind the NAT and configured with inbuilt micorosoft network firewall.

    Once again i know only VB6 and SQL 8(installtion, backup, restore some basics). So that i asked for the tutorials. if you dont mind can you give me the tutorials.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  21. #21
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connection string error

    Look at the FAQ's in the Database Forum for a start...

  22. #22
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Connection string error

    I don't think they will help much - the closest is for SQL Server 2005, but that uses different tools to SQL Server 2000 (which is not known as 8!). I haven't checked, but some of the advice in it might be useful.
    Hi, Only I need to learn how to working with STATIC IP
    No you don't - that part is exactly the same as you already had with a local IP.
    in my concern i am not authorized to using my DB in internet. ..
    This is the problem part, but there are lots of reasons why it might be the case, such as:
    • the IP address cannot be mapped to the database server.. so try to Ping that address (if it is successful, this is not the issue).
    • there is a firewall which is blocking the ports that SQL Server uses.
    • the database engine is set up to not allow remote connections.
    • ...

  23. #23

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Connection string error

    I have a TEST STATIC IP with me now, and the firewall disabled. Ping request OKAY.

    vb Code:
    1. Dim con As New ADODB.Connection
    2. Dim conString As String
    3. conString = "PROVIDER = SQLOLEDB;SERVER=XXX.XX.X.XX;UID=XXX;PWD=XXX;DATABASE=XXXX"
    4. con.ConnectionString = conString
    5. con.Open
    6. Set rs = con.Execute("select sname from names where id1 = 148")
    7. MsgBox rs(0)

    So the problem is in "the database engine is set up to not allow remote connections." can you please explain how to set this up?
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  24. #24
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Connection string error

    That wasn't the last possibility, just the last one I wrote out (hence the "..." item).

    I don't know off the top of my head how to set it up.. there are instructions for SQL Server 2005 here, but as I said before that is not likely to be very useful - you should try to find a SQL Server 2000 version of the that page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width