hey gabor
you have to define a DNS on your system. i assume that you know what DNS is
and how to create on windows. if not, say it!
afterwards check, if the odbc has been activated in your php.ini on
windows-directory!
the rest is easy:
the code looks like that:
if( !$con=odbc_connect($dns,$user,$pwd) ) exit; // establish
connection, if faild exit
$qry = "SELECT * FROM $table"; // generate
the query
$res=odbc_exec($con,$qry); //
execute query and get result
$fieldscnt = odbc_num_fields($res); // count
fields
while( $n = odbc_fetch_into($res,&$arr) ) // loop as
long as it has records and fetch data into array
{
for( $i=0; $i<$fieldscnt; $i++) //
loop all fields
echo $arr[$i]";
// display value in array on current field-element $i
}
if($res) odbc_free_result($res); // free
memory of result if there's a result
if($con) odbc_close($con); // free
connection if there's an established connection
as you can see, only a few lines...
cheers, j.a.z.
"Gabor Niederlaender" <[EMAIL PROTECTED]> schrieb im
Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all!
>
> I realized, that it is impossible to retrieve "ntext" from an MSSQL DB
> with php normally. (Is this correct?)
>
> But I think it should be possible to make it through ODBC.
> Can someone explain me how this goes? (I think I have set up one ODBC
> Data Source, but I am not sure) But I cannot even imagine how I use
> this stuff for establishing a connection...
>
> Does it really only go this way?
>
> Best regards,
> Gabor
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php