SqlExecute and binding
Thomas Flemming
tf at ttqv.com
Tue Nov 17 03:06:44 CST 2009
ok, it seems like I must do it like this:
Dim a(7) As Object
a(0) = Str(.coo.lat)
a(1) = Str(.coo.lon)
a(2) = Str(.coo.alt)
a(3) = .first_point
then the double and single are inserted correctly.
But in which format does a date/time has to be?
Is there a general string-format for datetime?
Tom
Thomas Flemming schrieb:
> Hi,
>
> I've some problems with bindings (with VNET):
>
> Dim a(3) as object
> a(0) = .coo.lat ' double
> a(1) = .coo.lon ' double
> a(2) = .coo.alt ' single
> a(3) = .first_point ' boolean
> a(4) = .coo.datetime ' date
>
> sql As String = "INSERT INTO [mytbl] (lat, lon, alt, fp, date)
> VALUES ( :1, :2, :3, :4, :5)"
> db.SqlExecute(sql, a)
>
> This works somehow, but lat, lon, alt are converted to integer.
> When I declare a(3) as String, then it works.
>
> Still I'm not able to insert into the date-field. If a(4) contains a date,
> then SqlExecute gives an exeption, something like "1,55 ")" expected"
>
> How can I insert into a table with mixed field-types?
>
> Regards,
> Tom
>
>
>
--
/****************************************
** Dipl.-Ing. Thomas Flemming
** Software Development
**
** Touratech AG
** Auf dem Zimmermann 7-9
** D-78078 Niedereschach
**
** mail tf at ttqv.com
** fon +49 (0) 7728 9279-206
** fax +49 (0) 7728 9279-29
**
** http://www.ttqv.com
** http://www.touratech.de
**
** ... und immer dem Pfeil nach!
***************************************/
More information about the Valentina
mailing list