Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Types in SQP Insert
Message
 
To
04/05/2004 15:31:57
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00900903
Message ID:
00901405
Views:
17
You don't want quotes around numeric or logical values. VFP dates need to be formatted differently too.

You really should be using Command Parameters for this stuff - it'll take care of all the conversions for you.

+++ Rick ---


>Hi,
>
>I'm having a hard time with my SQL insert statement that I am using in ASP.NET. I need to insert a record into a VFP free table. I can insert values as long as the field is a character field. I can not insert a logical, numerical, or DateTime because my SQL String converts all data to a character. My Sql string is below: Does anyone have any ideas on how I can fix this? Thank you.
>
>Tim
>
> Dim sb As New StringBuilder
> sb.Append("INSERT INTO testdb (Job_num, Slot, Date, Number ) Values( '")
> sb.Append("JN43")
> sb.Append("','")
> sb.Append("01"))
> sb.Append("','")
> sb.Append(DateTime.Now)
> sb.Append("','")
> sb.Append(204)
> sb.Append("')")
> myInsertString = sb.ToString()
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform