Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to read a dbf in WScript

3 posts in ODBC Last posting was on 2007-01-10 18:14:12.0Z
Vladimir Iahnenco Posted on 2007-01-09 18:29:39.0Z
From: "Vladimir Iahnenco" <iahnenco@yahoo.com>
Newsgroups: advantage.odbc
Subject: How to read a dbf in WScript
Date: Tue, 9 Jan 2007 13:29:39 -0500
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: 74.113.143.114
Message-ID: <45a3de12@solutions.advantagedatabase.com>
X-Trace: 9 Jan 2007 11:25:22 -0700, 74.113.143.114
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!74.113.143.114
Xref: solutions.advantagedatabase.com Advantage.ODBC:1688
Article PK: 1133068

Hi All,
Is it possible to open and read a dbf using ADS ODBC driver in WScript? I
just need to check if some value exists in some field.
An example would be great.

Thanks in advance,

Vladimir


Mark Wilkins Posted on 2007-01-09 18:59:18.0Z
From: "Mark Wilkins" <mark@no.email>
Newsgroups: advantage.odbc
References: <45a3de12@solutions.advantagedatabase.com>
Subject: Re: How to read a dbf in WScript
Date: Tue, 9 Jan 2007 11:59:18 -0700
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.228
Message-ID: <45a3e505@solutions.advantagedatabase.com>
X-Trace: 9 Jan 2007 11:55:01 -0700, 10.24.38.228
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.228
Xref: solutions.advantagedatabase.com Advantage.ODBC:1689
Article PK: 1133070

Hi Vladimir,

Here is a short example that reads a field. Change the DSN name, SELECT
statement, etc. as appropriate. It use the OLE DB provider for ODBC drivers
(msdasql). You could also go through the Advantage OLE DB provider simply
by changing the connection string and provider.

dim conn
dim rs

set conn=createobject("ADODB.Connection")

conn.provider="msdasql"
conn.connectionstring="dsn=THEDSN;uid=adssys;pwd=;"

' An OLE DB connection might look like this
'conn.provider="advantage.oledb.1"
'conn.connectionstring="data source=x:\w92p1;User ID=adssys;password="

conn.open

set rs=createobject("ADODB.Recordset")
set rs.activeconnection=conn

rs.source="select lastname from employee where empid=123"
rs.open

MsgBox "lastname = " + rs.fields("lastname")
rs.close

set rs = nothing
set conn = nothing

"Vladimir Iahnenco" <iahnenco@yahoo.com> wrote in message
news:45a3de12@solutions.advantagedatabase.com...
> Hi All,
> Is it possible to open and read a dbf using ADS ODBC driver in WScript? I
> just need to check if some value exists in some field.
> An example would be great.
>
> Thanks in advance,
>
> Vladimir
>


Vladimir Iahnenco Posted on 2007-01-10 18:14:12.0Z
From: "Vladimir Iahnenco" <iahnenco@yahoo.com>
Newsgroups: advantage.odbc
References: <45a3de12@solutions.advantagedatabase.com> <45a3e505@solutions.advantagedatabase.com>
Subject: Re: How to read a dbf in WScript
Date: Wed, 10 Jan 2007 13:14:12 -0500
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: 74.113.143.114
Message-ID: <45a52bf3@solutions.advantagedatabase.com>
X-Trace: 10 Jan 2007 11:09:55 -0700, 74.113.143.114
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!74.113.143.114
Xref: solutions.advantagedatabase.com Advantage.ODBC:1690
Article PK: 1133069

Thanks Mark,
That worked

Regards,
Vladimir

"Mark Wilkins" <mark@no.email> wrote in message
news:45a3e505@solutions.advantagedatabase.com...
> Hi Vladimir,
>
> Here is a short example that reads a field. Change the DSN name, SELECT
> statement, etc. as appropriate. It use the OLE DB provider for ODBC
> drivers (msdasql). You could also go through the Advantage OLE DB
> provider simply by changing the connection string and provider.
>
> dim conn
> dim rs
>
> set conn=createobject("ADODB.Connection")
>
> conn.provider="msdasql"
> conn.connectionstring="dsn=THEDSN;uid=adssys;pwd=;"
>
> ' An OLE DB connection might look like this
> 'conn.provider="advantage.oledb.1"
> 'conn.connectionstring="data source=x:\w92p1;User ID=adssys;password="
>
> conn.open
>
> set rs=createobject("ADODB.Recordset")
> set rs.activeconnection=conn
>
> rs.source="select lastname from employee where empid=123"
> rs.open
>
> MsgBox "lastname = " + rs.fields("lastname")
> rs.close
>
> set rs = nothing
> set conn = nothing
>
>
> "Vladimir Iahnenco" <iahnenco@yahoo.com> wrote in message
> news:45a3de12@solutions.advantagedatabase.com...
>> Hi All,
>> Is it possible to open and read a dbf using ADS ODBC driver in WScript? I
>> just need to check if some value exists in some field.
>> An example would be great.
>>
>> Thanks in advance,
>>
>> Vladimir
>>
>
>