Configure Win32::ODBC Connection to a SQL Server?
Author |
Message |
Carola Begeman #1 / 6
|
 Configure Win32::ODBC Connection to a SQL Server?
Hallo, I am trying to configure a new Connection to a database on a sql 7 server using the Win32::ODBC module. Can someone help me with the correct Attrbutes for the driver "SQL Server"? I can nor imagine how to correct the string Win32::ODBC::ConfigDSN(ODBC_ADD_SYS_DSN,"SQL Server", ( "DSN=$dsn","Description= $condb automatisch generiert", "Server=$server","Database=$condb", "UID=$user", "PWD=$passwd")) I get the error : No such file or directory (whatever that stands for). And if i try the GetDSN() command on an existing SQL server connection all I get back is a string showing the path to the driver DLL. I did manage to configure a new ODBC Connection to an Access database following the given example. Carola
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Eyal Ben-Davi #2 / 6
|
 Configure Win32::ODBC Connection to a SQL Server?
Quote:
> Hallo, > I am trying to configure a new Connection to a database on a sql 7 server > using the Win32::ODBC module. > Can someone help me with the correct Attrbutes for the driver "SQL Server"? > I can nor imagine how to correct the string > Win32::ODBC::ConfigDSN(ODBC_ADD_SYS_DSN,"SQL Server", > ( "DSN=$dsn","Description= $condb automatisch generiert", > "Server=$server","Database=$condb", "UID=$user", "PWD=$passwd")) > I get the error : No such file or directory (whatever that stands for). > And if i try the GetDSN() command on an existing SQL server connection all I > get back is a string showing the path to the driver DLL. > I did manage to configure a new ODBC Connection to an Access > database following the given example. > Carola
Hello, Create a data source with the ODBC administrator program. Then look at HKEY_LOCAL_MACHINE\Software\ODBC\DSN_Name You can set the values under this key as the attributes for ConfigDSN function. Eyal.
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Carola Begeman #3 / 6
|
 Configure Win32::ODBC Connection to a SQL Server?
Hello , Eyal Ben-David suggested to create the data source manually and then look in the registy for Details. It turned out that I had all attributes except "Driver=C:\WINNT\System32\sqlsrv32.dll " in my list. So I tried: Win32::ODBC::ConfigDSN(ODBC_ADD_SYS_DSN,"SQL Server", ( "DSN=$dsn","Description= $condb automatisch generiert", "Driver=C:\\WINNT\\System32\\sqlsrv32.dll", "Server=$server","Database=$condb", "UID=$user", "PWD=$passwd") Result still the same , even without the C: or with single \ and ( or) ' for " . Ieven tried the path in UNIX like fashion with correct uppercase and lowercase letters taken from the path shown in the NT explorer I still get the error : No such file or directory puzzeled Maybe I have to create the Connections manually, (not so nice , but works at least) Thanks Carola
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Mark Worsdal #4 / 6
|
 Configure Win32::ODBC Connection to a SQL Server?
Quote: >Hallo, >I am trying to configure a new Connection to a database on a sql 7 server >using the Win32::ODBC module. >Can someone help me with the correct Attrbutes for the driver "SQL Server"? >I can nor imagine how to correct the string > Win32::ODBC::ConfigDSN(ODBC_ADD_SYS_DSN,"SQL Server", > ( "DSN=$dsn","Description= $condb automatisch generiert", > "Server=$server","Database=$condb", "UID=$user", "PWD=$passwd")) >I get the error : No such file or directory (whatever that stands for). >And if i try the GetDSN() command on an existing SQL server connection all I >get back is a string showing the path to the driver DLL. >I did manage to configure a new ODBC Connection to an Access >database following the given example. > Carola
Naive i/p by me: Have you created a connection in the windows control panel to the database? If not, does that help? (ODBC Data Sources) -- He came from Econet - Oh no, I've run out of underpants :(
Web site Monitoring:- http://www.shadow.org.uk/SiteSight/
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
#5 / 6
|
 Configure Win32::ODBC Connection to a SQL Server?
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
 |
Carola Begeman #6 / 6
|
 Configure Win32::ODBC Connection to a SQL Server?
Quote: >Hallo, >I am trying to configure a new Connection to a database on a sql 7 server >using the Win32::ODBC module.
After a lot of trial and Error the Solution was as simle as: Win32::ODBC::ConfigDSN(ODBC_ADD_SYS_DSN,"SQL Server", ( "DSN=$dsn","Description= $condb automatisch generiert", "Server=$server") note : give only these attributes and use the rest in the connect string! here attributes are separated by ; $dbc=new Win32::ODBC( "DSN=$dsn; UID=$user; PWD=$passwd; Database=$condb ") Just in case anyboy needs this Carola
|
Wed, 18 Jun 1902 08:00:00 GMT |
|
|
|