Vb/SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RioDog
    New Member
    • Jul 2006
    • 4

    Vb/SQL

    Can anyone tell me how to construct an sql insert statement that includes a variable? Please? Thanks!
  • tf-centurion
    New Member
    • Jul 2006
    • 3

    #2
    Originally posted by RioDog
    Can anyone tell me how to construct an sql insert statement that includes a variable? Please? Thanks!

    Hi RioDog,

    if your inserting a string then use
    sSql = "INSERT INTO tablename (fieldname) values(" & chr$(34) & sString & chr$(34) & ");"
    dbconn.Execute sSql

    if your inserting a number then use
    sSql = "INSERT INTO tablename (fieldname) values(" & iInteger ");"
    dbconn.Execute sSql

    hope this helps :)

    Comment

    • RioDog
      New Member
      • Jul 2006
      • 4

      #3
      Hi tf_centurian

      Thanks!!!

      Comment

      Working...