Hey all. I'm a noob so please be gentle... lol

I'm trying to update my access database via VB.NET 2003 by registering new users into the site. I have an INSERT Command and an OleDb.OleDbConnection but can't get it to work...

Any suggestions would be greatly appreciated
Thanks…

Recommended Answers

All 4 Replies

Member Avatar for iamthwee

That's pretty vague. Please clarify.

>>Any suggestions would be greatly appreciated

Yes, please post code

>>Any suggestions would be greatly appreciated

Yes, please post code

Okay, I'll post it as soon as I get out of work...

Thanks...

Here's my code sorry for the delay...

I'm trying to create a new user by saving storing the login info into an access database. The program compiles but doesn't create the user... any help would gladdy be appreciated.

sorry for the extra code...

thanks

Public Class LogIn
    Inherits System.Web.UI.Page

 Dim myConnection As OleDb.OleDbConnection
    Dim ConString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\Users$.mdb"

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub




    Private Sub UserName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserName.TextChanged

    End Sub

    Private Sub UserPassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserPassword.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        Dim ConString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\Users$.mdb"
        'The connection string is used to describe the type of database, the security information and the location to the database.
        'Create a new connection object and assign the ConString Connection String above
        Dim DBCon As New OleDb.OleDbConnection(ConString)

        DBCon.Open()

        Dim queryString As String = "INSERT INTO [Users$] ([UserID]," & _
"[Password]) VALUES (@UserName, @UserPassword)"



        Dim cm As New OleDb.OleDbCommand(queryString, DBCon)

        Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
        dbCommand.CommandText = queryString
        dbCommand.Connection = DBCon








    End Sub
End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.