Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7418503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:53:58+00:00 2026-05-29T07:53:58+00:00

CURRENT PROGRESS TOWARD SOLUTION: This is the updated code: sql = INSERT INTO Strings

  • 0

CURRENT PROGRESS TOWARD SOLUTION:

This is the updated code:

sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text, Alternate_Text, Multi_String_ID, Lang_ID) VALUES (?,?, ?,?,?,?)"

Dim command = New OleDbCommand(sql, pConn)

command.Parameters.AddWithValue("@webStringName", "String_Name")
command.Parameters.AddWithValue("@webLang_String", "Long_Text")
command.Parameters.AddWithValue("@ptsShortText", "Short_Text")
command.Parameters.AddWithValue("@webAltText", "Alternate_Text")
command.Parameters.AddWithValue("@webMultiStringID", "Multi_String_ID")

Changed above line to this…
command.Parameters.AddWithValue(“@webMultiStringID”, OleDbType.Integer).Value = webMultiStringID

command.Parameters.AddWithValue("@webLang_Code", "Lang_ID")

command.ExecuteNonQuery()

ORIG POST:

I am trying to create and INSERT statement with and OLE adapter. I had it working without paramtersm but now I am trying to add parms and am having issues with the syntax. Ha

Here is the code so far…

command = New OleDbCommand(sql, pConn)

sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text) VALUES (?,?, """ & ptsShortText & """)"


command.Parameters.Add("@webStringName", OleDbType.VarChar, 250, "String_Name")
command.Parameters.Add("@webLang_String", OleDbType.VarChar, 250, "Long_Text")

command = New OleDbCommand(sql, pConn)
command.ExecuteNonQuery()

Was just trying to get the first two variables parameterized.

Any suggestions would be greatly appreciated.

EDIT: Fixed SQL

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:53:59+00:00Added an answer on May 29, 2026 at 7:53 am

    You are doing something wrong. You first add the parameters:

    command.Parameters.Add("@webLang_String", OleDbType.VarChar, 250, "Long_Text")
    

    and then replace the command with a new one (with no parameters):

    command = New OleDbCommand(sql, pConn)
    

    Thus, you remove all your existing parameters in this line. That’s why it doesn’t work.


    You have to do it in the correct order:

    sql = "INSERT INTO Strings (String_Name, Long_Text, Short_Text) " & _
          "VALUES (?,?, """ & ptsShortText & """)"
    
    Dim command = New OleDbCommand(sql, pConn)  ' First create the command
    
    ' Then add the parameters to the command
    command.Parameters.AddWithValue("@webStringName", "String_Name")
    command.Parameters.AddWithValue("@webLang_String", "Long_Text")
    
    ' Then execute the command. (DON'T recreate it with New OleDbCommand here,
    ' that would throw away all you've done so far.)
    command.ExecuteNonQuery()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I' trying to use window.pageYOffset & window.scrollMaxY to calculate the current page progress. This
current code I've built function to do something over collection of jQuery elements: var
My current view is no, prefer Transact SQL stored procedures because they are a
I am trying to write a simple application that gets updated. For this I
Hello when I try to set the current progress of a seekbar that is
I dont know how to show the current progress in progressBar component when the
I have javascript/jquery code which fetches info and updates it into the database with
I am making great progress on a current project, but of coarse, now I
Current, I've got a stored procedure that has a main goal of doing a
Current situation: Ubuntu 8.04 server edition (live server) Postgresql 8.3.7 (from standard repositories) Postgis

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.