CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jul 2013
    Posts
    8

    ADO Connection problem in C++ Builder

    Hi my friends.I try to connect my application in C++ builder 6 from my home pc by ADOConnection string, to a database in MSSQL Server installed on my work pc that has a static IP(Public IP). I already open a UDP 1433 port on both routers (home & work)and i have apply an exception in both firewalls for SQL server and C++ application respectively...but i can't connect to database. Does anybody know the complete procedure step by step for the connection please ?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ADO Connection problem in C++ Builder

    How does your ADOConnection string look like?
    What error/exception do you get?
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2013
    Posts
    8

    Re: ADO Connection problem in C++ Builder

    One of the connection strings that i try

    Provider=SQLOLEDB.1;Persist Security Info=False;User ID=xxxxx;Data Source=192.168.1.15;Network Address=xx.xx.xx.xxx;Network Library=DBMSSOCN

    I return the routers port to TCP/IP 1433 (so the Network Library=DBMSSOCN)
    Network address = SQL Server Public IP
    Data source =SQL Server Local IP

    I'm sure something is wrong but i don't know what...

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: ADO Connection problem in C++ Builder

    Quote Originally Posted by GeoAstrix View Post
    One of the connection strings that i try

    Provider=SQLOLEDB.1;Persist Security Info=False;User ID=xxxxx;Data Source=192.168.1.15;Network Address=xx.xx.xx.xxx;Network Library=DBMSSOCN

    I return the routers port to TCP/IP 1433 (so the Network Library=DBMSSOCN)
    Network address = SQL Server Public IP
    Data source =SQL Server Local IP

    I'm sure something is wrong but i don't know what...
    Your functions don't return error or status codes? Do you check them in your program?

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Jul 2013
    Posts
    8

    Re: ADO Connection problem in C++ Builder

    Can't find SQL Server or access denied

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ADO Connection problem in C++ Builder

    Quote Originally Posted by GeoAstrix View Post
    Can't find SQL Server or access denied
    Is TCP/IP enabled? (look at the SQL Server Configuration manager!)
    Victor Nijegorodov

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ADO Connection problem in C++ Builder

    did you ask the network/LAN admin?
    Victor Nijegorodov

  8. #8
    Join Date
    Jul 2013
    Posts
    8

    Re: ADO Connection problem in C++ Builder

    Unfortunately.....i am the admin .I am agricultural scientist and hydroponic greenhouse owner.Also i am "Information and Telecommunication" student so i am trying to serve my network without experience.

  9. #9
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ADO Connection problem in C++ Builder

    Quote Originally Posted by GeoAstrix View Post
    Unfortunately.....i am the admin
    Then try to turn off the firewall.
    Besides, SQLOLEDB is obsolete (for SQL Server 2000). You should use SQLNCLI11 for the recent versions.
    Victor Nijegorodov

  10. #10
    Join Date
    Jul 2013
    Posts
    8

    Re: ADO Connection problem in C++ Builder

    I found my mistake.

    Wrong syntax:
    Network address = SQL Server Public IP
    Data source =SQL Server Local IP

    Correct syntax:
    Network address =SQL Server Local IP
    Data source =SQL Server Public IP

    thanks for your time and your interest .

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

Featured