Configure Win32::ODBC Connection to a SQL Server? 
Author Message
 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  
 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  
 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  
 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  
 Configure Win32::ODBC Connection to a SQL Server?


Wed, 18 Jun 1902 08:00:00 GMT  
 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  
 
 [ 6 post ] 

 Relevant Pages 

1. LONG: Req: Help in retrieving values from SQL Server stored procedure using Win32::ODBC

2. Win32:ODBC and Microsoft's SQL Server 6.5

3. Win32::ODBC and transactions with SQL Server

4. SQL Server 7 and Win32::ODBC perl module

5. Win32::ODBC strangeness with SQL Server databases?

6. SQL Server 7 and Win32::ODBC perl module

7. Win32::ODBC strangeness with SQL Server databases?

8. DBD::ODBC::db prepare failed: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'tblClient'. (SQL-S0002)

9. Win32::ODBC, Perl SQL vs. standard SQL

10. SQL Server Table Connection - Example

11. Remote MS SQL server connection problem - HELP! (please)

12. Connection to Microsoft SQL Server

 

 
Powered by phpBB® Forum Software