Skip to Content.
Sympa Menu

freetds - [freetds] Connect problem to MSSQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: william van der wee <w_wee09 AT yahoo.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Connect problem to MSSQL
  • Date: Mon, 18 Oct 2004 04:46:54 -0700 (PDT)

Hi all,

I have the following problem. I have configured
FreeTDS with
./configure --prefix=/usr/local/freetds
--with-unixodbc=/usr/bin
I can isql -v LocalServer user pass, without any
problem. But when I try to use odbc_connect in a
php script there is a problem. Here is the
odbctest.php script
(same as the sample which comes with FreeTDS

<?
// connect to a DSN "mydb" with a user and password
"marin"
$connect = odbc_connect("LocalServer", "user",
"pass");

// query the users table for name and surname
$query = "SELECT * from sysusers";


// perform the query
$result = odbc_exec($connect, $query);


// fetch the data from the database
while(odbc_fetch_row($result)){
$suid = odbc_result($result, 1);
$uid = odbc_result($result, 2);
$gid = odbc_result($result, 3);
$name = odbc_result($result, 4);
print("$name|$suid|$uid|$gid\n");
}

// close the connection
odbc_close($connect);
?>

With php odbctest.php it gives:
Segmentation fault

With gdb php
(gdb) run odbctest.php
Starting program: /usr/bin/php odbctest.php
(no debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...[Thread debugging using libthread_db
enabled]
[New Thread 1077063808 (LWP 11852)]
(no debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols
found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging
symbols found)...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1077063808 (LWP 11852)]
0x40328920 in main_arena () from /lib/tls/libc.so.6
==============================================================
(gdb) bt
#0 0x40328920 in main_arena () from
/lib/tls/libc.so.6
Cannot access memory at address 0x0

Her is my odbc.ini in /etc/unixODBC/
[ODBC Data Sources]
LocalServer = MS SQL Server

[LocalServer]
Driver = TDS
Description = MS SQL Server
Trace = No
Server = wk6
Database = 001
PORT = 1433

This is my /etc/unixODBC/odbcinst.ini

[TDS]
Description = v0.62 with protocol v8.0
Driver = /usr/local/freetds/lib/libtdsodbc.so
FileUsage = 2

And this my freetds.conf in /usr/local/freetds/etc/

freetds.conf
[global]
# TDS protocol version
tds version = 4.2

; initial block size = 512

[Server]
host = wk6
port = 1433
tds version = 8.0

I hope somebody can help me as I'am trying to get this
to work allready for a long time, but no idea
where I have to look for.

Any help, or suggestions are apreciated

Rgd

William

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



  • [freetds] Connect problem to MSSQL, william van der wee, 10/18/2004

Archive powered by MHonArc 2.6.24.

Top of Page