Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C358F9FB262 for ; Tue, 6 Mar 2007 09:54:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 01992-01 for ; Tue, 6 Mar 2007 09:54:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id 0D0029FB1CD for ; Tue, 6 Mar 2007 09:54:50 -0400 (AST) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Tue, 06 Mar 2007 14:42:15 +0100 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Tue, 06 Mar 2007 14:54:49 +0100 Message-Id: <45ED80AB.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Tue, 06 Mar 2007 14:54:35 +0100 From: "Bart Degryse" To: Subject: Re: convert to a string References: <011901c75ff5$57a38930$1102a8c0@dream> In-Reply-To: <011901c75ff5$57a38930$1102a8c0@dream> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part391D9C8B.0__=" X-imss-version: 2.046 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.405 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200703/34 X-Sequence-Number: 27672 --=__Part391D9C8B.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I assume GetFieldValue is the name of a VB function or property get? =20 Try either Set oRs =3D oConn.Execute("SELECT N_GEN::int FROM MyTable ORDER BY N_GEN = DESC") or GetFieldValue =3D cint(oRs("N_GEN")) + 1 or GetFieldValue =3D clng(oRs("N_GEN")) + 1 In the last two cases make sure that the function or property get returns = an int or long Also remember that if oRs("N_GEN") is NULL the sum will also be NULL >>> "Shavonne Marietta Wijesinghe" = 2007-03-06 14:42 >>> Hello=20 i have a column N_GEN in postgreSql defined as text. In this coloumn i = insert a number 10 N_GEN (text) =3D 10=20 =20 =20 on error resume next Set oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN = DESC") If err <> 0 then 'If table not found GetFieldValue =3D "1" else GetFieldValue =3D oRs("N_GEN") + 1 End If =20 But it doesn't add the 1 to my N_GEN How can i set the Recordset to convert the string to a number and then add = 1 to it?? =20 Shavonne Wijesinghe http://www.studioform.it ( http://www.studioform.it/ ) =20 =20 --=__Part391D9C8B.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
I assume GetFieldValue is the name of a VB function or property = get?
 
Try either
  Set oRs =3D oConn.Execute("SELE= CT N_GEN::int FROM MyTable ORDER BY N_GEN DESC")
or
   GetFieldValue =3D = cint(oRs("N_GEN")) + 1
or
   GetFieldValue =3D = clng(oRs("N_GEN")) + 1

In the last two cases make sure that the = function or property get returns an int or long
Also remember that if oRs("N_GEN") is NULL = the sum will also be NULL

>>> "Shavonne Marietta = Wijesinghe" <shavonne.marietta@studioform.it> 2007-03-06 14:42 = >>>
Hello

i have a column = N_GEN in postgreSql defined as text. In this coloumn i insert a number = 10

N_GEN (text) =3D 10
 
 
on error resume next
  Set = oRs =3D oConn.Execute("SELECT N_GEN FROM MyTable ORDER BY N_GEN DESC")
&= nbsp; If err <> 0 then 'If table not found
   = GetFieldValue =3D "1"
  else
   GetFieldValu= e =3D oRs("N_GEN") + 1
  End If
 
But it doesn't add the 1 to my N_GEN
How can i set the Recordset = to convert the string to a number and then add 1 to it??
 
Shavonne Wijesinghe
http://www.studioform.it
 

 
--=__Part391D9C8B.0__=--