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

  • Home
  • SEARCH
  • 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 7708843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:43:00+00:00 2026-06-01T00:43:00+00:00

Can anyone tell me what’s wrong with this code? It’s giving me an error

  • 0

Can anyone tell me what’s wrong with this code? It’s giving me an error in cmd.ExecuteNonQuery()

Protected Sub btnCreateAccount_Click(sender As Object, e As System.EventArgs) Handles btnCreateAccount.Click

    Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Brian\Documents\Visual Studio 2010\WebSites\WebSite3\db.mdb;")

    Dim cmd As OleDbCommand = New OleDbCommand("INSERT INTO [User] (CustomerName, CustomerSurname, Address, Country, TelNo, Username, Password, UserTypeID) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", conn)




    If txtPass.Text = txtCPass.Text Then

        conn.Open()


        cmd.Parameters.Add("@CustomerName", OleDbType.VarChar, 255).Value = txtName.Text
        cmd.Parameters.Add("@CustomerSurname", OleDbType.VarChar, 255).Value = txtSurname.Text
        cmd.Parameters.Add("@Address", OleDbType.VarChar, 255).Value = txtAddress.Text
        cmd.Parameters.Add("@Country", OleDbType.VarChar, 255).Value = txtCountry.Text
        cmd.Parameters.Add("@TelNo", OleDbType.Integer).Value = txtTelNo.Text
        cmd.Parameters.Add("@Username", OleDbType.VarChar, 255).Value = txtUsername.Text
        cmd.Parameters.Add("@Password", OleDbType.VarChar, 255).Value = txtPass.Text
        cmd.Parameters.Add("@UserTypeID", OleDbType.Integer, 255).Value = "1"





        cmd.ExecuteNonQuery()

        conn.Close()
        lblAccount.Visible = True



    End If

End Sub

End Class

  • 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-06-01T00:43:01+00:00Added an answer on June 1, 2026 at 12:43 am

    EDIT: It’s probably that username and password are reserved keywords in Access.

    Try to surround them with brackets:

     ..., TelNo, [Username], [Password], ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone tell me what is going wrong with this code? I tried to
Can anyone tell me what I a doing wrong with this code? I am
Can anyone tell me what is wrong with this code? public abstract class BoardTestBean{
Can anyone tell me what exactly does this Java code do? SecureRandom random =
Can anyone tell me why this code would throw an undefined is not a
Can anyone tell me why this code crashes with SIGABRT unrecognised selector sent to
can anyone tell me why this animation isn't starting? i've tried putting code in
Can anyone tell me why this code generates queue after starting the threads? Basically,
Can anyone tell me why this code is returning undefined . I was hoping
Can anyone tell me how to open Auto CAD file in HTML5? Is this

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.