-
July 12th, 2013, 08:10 AM
#1
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 ?
-
July 13th, 2013, 04:01 PM
#2
Re: ADO Connection problem in C++ Builder
How does your ADOConnection string look like?
What error/exception do you get?
Victor Nijegorodov
-
July 14th, 2013, 10:08 AM
#3
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...
-
July 14th, 2013, 12:07 PM
#4
Re: ADO Connection problem in C++ Builder
Originally Posted by GeoAstrix
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
-
July 14th, 2013, 12:53 PM
#5
Re: ADO Connection problem in C++ Builder
Can't find SQL Server or access denied
-
July 14th, 2013, 02:48 PM
#6
Re: ADO Connection problem in C++ Builder
Originally Posted by GeoAstrix
Can't find SQL Server or access denied
Is TCP/IP enabled? (look at the SQL Server Configuration manager!)
Victor Nijegorodov
-
July 14th, 2013, 04:36 PM
#7
Re: ADO Connection problem in C++ Builder
Yes Victor .TCP/IP (port 1433) and Named Pipes Protocols are enabled
-
July 14th, 2013, 06:27 PM
#8
Re: ADO Connection problem in C++ Builder
Originally Posted by GeoAstrix
Yes Victor .TCP/IP (port 1433) and Named Pipes Protocols are enabled
How do we know it's not something simple, such as a bad or stray character in your connect string? How about showing us how you are setting this string. In C++, there are many ways to screw up string handling.
Second, do you have an existing application that you did not write that attempts to do what you're trying to do? If so, does it work correctly?
Regards,
Paul McKenzie
-
July 15th, 2013, 10:09 AM
#9
Re: ADO Connection problem in C++ Builder
My application running without problems in my work LAN.The problem appears in attempt to connect from other pc (out of LAN).Probably the declaration of public ip is incorrect or the restrictions from both router and firewall not allow the connection .
-
July 15th, 2013, 03:18 PM
#10
Re: ADO Connection problem in C++ Builder
did you ask the network/LAN admin?
Victor Nijegorodov
-
July 15th, 2013, 03:40 PM
#11
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.
-
July 16th, 2013, 01:12 AM
#12
Re: ADO Connection problem in C++ Builder
Originally Posted by GeoAstrix
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
-
July 16th, 2013, 12:43 PM
#13
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|