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.

Help! Reading/Writing to Numeric fields in DBF files...

3 posts in Visual Basic Last posting was on 2006-10-19 21:07:52.0Z
Denise et Robert Posted on 2006-10-19 14:56:16.0Z
From: "Denise et Robert" <robert.cote@sympatico.ca>
Newsgroups: Advantage.Visual_Basic
Subject: Help! Reading/Writing to Numeric fields in DBF files...
Date: Thu, 19 Oct 2006 10:56:16 -0400
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
X-Antivirus: avast! (VPS 0642-3, 10/19/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 67.68.253.79
Message-ID: <45379110@solutions.advantagedatabase.com>
X-Trace: 19 Oct 2006 08:52:00 -0700, 67.68.253.79
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!67.68.253.79
Xref: solutions.advantagedatabase.com Advantage.Visual_Basic:1112
Article PK: 1137907

I am new to VB and while I am able to read character fields, I cannot acces
numeric fields in an existing DBF file. Can someone point me in the right
direction.
The follwing code works well as long a the field type is character but I get
a 7200 error when it is numeric:
In the case below, PRIX is a numeric field and "nouveauprix" is the value I
want to use as the new value.
I need to capture "nouveauprix" in a character based object initially -
cncli.open

changeprix = "Update InvVb set PRIX ='" & nouveauprix & "' from InvVb where
CDMV ='" & Me.Txtcode.Text & "';"

changecmd = New AdsCommand(changeprix, cncli)

changecmd.ExecuteNonQuery()

cncli.Close()



Thanks in advance,



Robert


Mark Wilkins Posted on 2006-10-19 20:07:47.0Z
From: "Mark Wilkins" <mark@no.email>
Newsgroups: Advantage.Visual_Basic
References: <45379110@solutions.advantagedatabase.com>
Subject: Re: Help! Reading/Writing to Numeric fields in DBF files...
Date: Thu, 19 Oct 2006 14:07:47 -0600
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.228
Message-ID: <4537da20@solutions.advantagedatabase.com>
X-Trace: 19 Oct 2006 14:03:44 -0700, 10.24.38.228
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.228
Xref: solutions.advantagedatabase.com Advantage.Visual_Basic:1113
Article PK: 1137906

Hi Robert,

What was the error text? That may help correct the problem. If the PRIX
field is numeric, then I think you need to remove the single quote from the
UPDATE statement around the nouveauprix value. In addition, I think the
"from" clause is not needed in this situation - I don't think it is
providing any difference in the UPDATE statement.

changeprix = "Update InvVb set PRIX =" & nouveauprix & " where CDMV ='" &
Me.Txtcode.Text & "';"

Mark Wilkins
Advantage R&D

"Denise et Robert" <robert.cote@sympatico.ca> wrote in message
news:45379110@solutions.advantagedatabase.com...
>I am new to VB and while I am able to read character fields, I cannot acces
>numeric fields in an existing DBF file. Can someone point me in the right
>direction.
> The follwing code works well as long a the field type is character but I
> get a 7200 error when it is numeric:
> In the case below, PRIX is a numeric field and "nouveauprix" is the value
> I want to use as the new value.
> I need to capture "nouveauprix" in a character based object initially -
> cncli.open
>
> changeprix = "Update InvVb set PRIX ='" & nouveauprix & "' from InvVb
> where CDMV ='" & Me.Txtcode.Text & "';"
>
> changecmd = New AdsCommand(changeprix, cncli)
>
> changecmd.ExecuteNonQuery()
>
> cncli.Close()
>
>
>
> Thanks in advance,
>
>
>
> Robert
>
>


Denise et Robert Posted on 2006-10-19 21:07:52.0Z
From: "Denise et Robert" <robert.cote@sympatico.ca>
Newsgroups: Advantage.Visual_Basic
References: <45379110@solutions.advantagedatabase.com> <4537da20@solutions.advantagedatabase.com>
Subject: Re: Help! Reading/Writing to Numeric fields in DBF files...
Date: Thu, 19 Oct 2006 17:07:52 -0400
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
X-Antivirus: avast! (VPS 0642-3, 10/19/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 67.68.253.79
Message-ID: <4537e82d@solutions.advantagedatabase.com>
X-Trace: 19 Oct 2006 15:03:41 -0700, 67.68.253.79
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!67.68.253.79
Xref: solutions.advantagedatabase.com Advantage.Visual_Basic:1114
Article PK: 1137905

Thanks Mark,
I will try it out and see and get back to the group with the result.

Robert

"Mark Wilkins" <mark@no.email> wrote in message
news:4537da20@solutions.advantagedatabase.com...
> Hi Robert,
>
> What was the error text? That may help correct the problem. If the PRIX
> field is numeric, then I think you need to remove the single quote from
> the UPDATE statement around the nouveauprix value. In addition, I think
> the "from" clause is not needed in this situation - I don't think it is
> providing any difference in the UPDATE statement.
>
> changeprix = "Update InvVb set PRIX =" & nouveauprix & " where CDMV ='" &
> Me.Txtcode.Text & "';"
>
> Mark Wilkins
> Advantage R&D
>
> "Denise et Robert" <robert.cote@sympatico.ca> wrote in message
> news:45379110@solutions.advantagedatabase.com...
>>I am new to VB and while I am able to read character fields, I cannot
>>acces numeric fields in an existing DBF file. Can someone point me in the
>>right direction.
>> The follwing code works well as long a the field type is character but I
>> get a 7200 error when it is numeric:
>> In the case below, PRIX is a numeric field and "nouveauprix" is the value
>> I want to use as the new value.
>> I need to capture "nouveauprix" in a character based object initially -
>> cncli.open
>>
>> changeprix = "Update InvVb set PRIX ='" & nouveauprix & "' from InvVb
>> where CDMV ='" & Me.Txtcode.Text & "';"
>>
>> changecmd = New AdsCommand(changeprix, cncli)
>>
>> changecmd.ExecuteNonQuery()
>>
>> cncli.Close()
>>
>>
>>
>> Thanks in advance,
>>
>>
>>
>> Robert
>>
>>
>
>