For Programmers: Free Programming Magazines  


Home > Archive > Clarion > October 2006 > Topspeed odbc and adodb









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Topspeed odbc and adodb
jdavis71@gmail.com

2006-10-12, 6:55 pm

I am trying to create reports from tps files using vbscripts, as I do
with MySQL. I have version 3 of the Topspeed ODBC drivers, but my
output for one of my fields is incorrect.

TPS file info:
The tps field is Decimal(13,0), and an example entry would be
"999,123". When I perform my select statement, the result is always 0
(zero). All other fields export properly, so I am wondering if it has
something to do with the field type. Below is a sample of the code:

~~~

conn.open "DBQ=c:\stitps\;DRIVER=Topspeed ODBC Driver;"

strsql = "SELECT snum,asnum,lname,fname,mname,suffix,sex,
dob,race,grade
from stu where ((wd = 0) and (inactive = 0)) order by snum desc,asnum
desc"
set rs = createobject("adodb.recordset")
rs.open strsql, conn, adopendynamic, adlockoptimistic

Do While NOT RS.EOF

schnum = trim(rs(0))
altstn = trim(rs(1))
lname = trim(rs(2))
fname = trim(rs(3))
mname = trim(rs(4))
nsuffix = trim(rs(5))
gend = trim(rs(6))
dob = trim(rs(7))
ethnicity = trim(rs(8))
grade = trim(rs(9))

objfile.writeline (schnum & "," & altstn & "," & lname & "," & fname &
"," & mname & "," & nsuffix & "," & gend & "," & dob & "," & ethnicity)

rs.movenext
loop
rs.close

~~~

I do not know if upgrading to Topspeed 5 would help, or if my logic is
flawed (most likely!).

Thanks for any input,

-JD

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com