Alaska Software Inc. - ODBC - SQL Server. Error while reading a file
Username: Password:
AuthorTopic: ODBC - SQL Server. Error while reading a file
Angel LafuenteODBC - SQL Server. Error while reading a file
on Thu, 15 Apr 2021 11:14:07 +0200
Hello,

I need to query some tables from a SQL Server. I think I am making the 
connections correctly, but I always get the same error.

Xbase version: 2.00.1400


    DbeLoad( "ODBCDBE" )
    DbeSetDefault( "ODBCDBE" )

    cConnect := "DBE=ODBCDBE;"+;
                "DRIVER=SQL Server;"+;
                "SERVER=213.22.44.212;"+;
                "DATABASE=crampi2020;"+;
                "UID=usuario;"+;
                "PWD=clave"

    oSQL := DacSession():new( cConnect )

    DbUseArea( .T., oSQL, "dbo.centres", "centres", .F., .T. )

    centres->(DbGoTop())
    DO WHILE !centres->(Eof())

       ? centres->cod			 Works fine
       ? centres->direc			 Error: genCode 73, Error while reading a file

       centres->(dbskip())

    ENDDO


TIA
Jorge L. BorlandoRe: ODBC - SQL Server. Error while reading a file
on Fri, 16 Apr 2021 12:15:12 -0300
hi Angel, trie change de name of field "direc" by "direc_"


"Angel Lafuente" escribió en el mensaje de 
noticias:8a7976a$38a6eabf$395dc@news.alaska-software.com...

Hello,

I need to query some tables from a SQL Server. I think I am making the
connections correctly, but I always get the same error.

Xbase version: 2.00.1400


    DbeLoad( "ODBCDBE" )
    DbeSetDefault( "ODBCDBE" )

    cConnect := "DBE=ODBCDBE;"+;
                "DRIVER=SQL Server;"+;
                "SERVER=213.22.44.212;"+;
                "DATABASE=crampi2020;"+;
                "UID=usuario;"+;
                "PWD=clave"

    oSQL := DacSession():new( cConnect )

    DbUseArea( .T., oSQL, "dbo.centres", "centres", .F., .T. )

    centres->(DbGoTop())
    DO WHILE !centres->(Eof())

       ? centres->cod  Works fine
       ? centres->direc  Error: genCode 73, Error while reading a file

       centres->(dbskip())

    ENDDO


TIA
Carlos A Beling Re: ODBC - SQL Server. Error while reading a file
on Fri, 16 Apr 2021 17:59:22 -0300
Hi Angel.
I receive this error even not using SQL.
I could not discover why.

Fraternally
Beling

On 15/04/2021 06:14, Angel Lafuente wrote:
> Hello,
> 
> I need to query some tables from a SQL Server. I think I am making the 
> connections correctly, but I always get the same error.
> 
> Xbase version: 2.00.1400
> 
> 
>    DbeLoad( "ODBCDBE" )
>    DbeSetDefault( "ODBCDBE" )
> 
>    cConnect := "DBE=ODBCDBE;"+;
>                "DRIVER=SQL Server;"+;
>                "SERVER=213.22.44.212;"+;
>                "DATABASE=crampi2020;"+;
>                "UID=usuario;"+;
>                "PWD=clave"
> 
>    oSQL := DacSession():new( cConnect )
> 
>    DbUseArea( .T., oSQL, "dbo.centres", "centres", .F., .T. )
> 
>    centres->(DbGoTop())
>    DO WHILE !centres->(Eof())
> 
>       ? centres->cod             Works fine
>       ? centres->direc             Error: genCode 73, Error while 
> reading a file
> 
>       centres->(dbskip())
> 
>    ENDDO
> 
> 
> TIA
Matej JuracRe: ODBC - SQL Server. Error while reading a file
on Tue, 20 Apr 2021 11:18:04 +0200
Should not be there select clause as in

"SELECT * FROM dbo.centres" as in regular use of sql.

mind MS SQL is not case sensitive.

Carlos A Beling je 16.4.2021 ob 22:59 napisal:
> Hi Angel.
> I receive this error even not using SQL.
> I could not discover why.
> 
> Fraternally
> Beling
> 
> On 15/04/2021 06:14, Angel Lafuente wrote:
>> Hello,
>>
>> I need to query some tables from a SQL Server. I think I am making the 
>> connections correctly, but I always get the same error.
>>
>> Xbase version: 2.00.1400
>>
>>
>>    DbeLoad( "ODBCDBE" )
>>    DbeSetDefault( "ODBCDBE" )
>>
>>    cConnect := "DBE=ODBCDBE;"+;
>>                "DRIVER=SQL Server;"+;
>>                "SERVER=213.22.44.212;"+;
>>                "DATABASE=crampi2020;"+;
>>                "UID=usuario;"+;
>>                "PWD=clave"
>>
>>    oSQL := DacSession():new( cConnect )
>>
>>    DbUseArea( .T., oSQL, "dbo.centres", "centres", .F., .T. )
>>
>>    centres->(DbGoTop())
>>    DO WHILE !centres->(Eof())
>>
>>       ? centres->cod             Works fine
>>       ? centres->direc             Error: genCode 73, Error while 
>> reading a file
>>
>>       centres->(dbskip())
>>
>>    ENDDO
>>
>>
>> TIA