#1
  1. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Jul 2004
    Location
    staffordshire
    Posts
    280
    Rep Power
    11

    Angry BC30002: Type 'OleDbConnection' is not defined???? any ideas


    getting error message BC30002: Type 'OleDbConnection' is not defined.and I don't know why here is my code if someone can have a look I would be very grateful

    Sub btnSubmitDetails_Click(sender As Object, e As EventArgs)

    Code:
        Dim strConn, strSQLQuery As String
        Dim dbConn As OleDbConnection
        Dim dComm As OleDbCommand
        Dim dReader As OleDbDataReader
    
        strConn = "Provider=Microsoft.Jet.OLEB.4.0;DATA Source = " & Server.MapPath ("db/users.mdb") & ";"
        dbConn = New OleDbConnection(strConn)
    
        strSQLQuery = "Insert into users (username, password, email) values (@txtusernameReg, @txtpassReg, txtemailReg)"
    
        dComm = New OleDbCommand (strQuery, dbConn)
        dComm.Parameters.Add(New OleDbParameter (@txtusernameReg, txtusernameReg.Text))
        dComm.Parameters.Add(New OleDbParameter (@txtpassReg, txtpassReg.Text))
        dComm.Parameters.Add(New OleDbParameter (@txtemailReg, txtemailReg.Text))
    
        db.Open()
        d.Comm.ExecuteNonQuery()
    
    End Sub
    thanks sessie
    <........on my list of things to do is NEVER write a list..........>

    <........If you found me useful, do the scale thing!!!!!..........>
  2. #2
  3. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Nov 2005
    Location
    Canto 34
    Posts
    35
    Rep Power
    10
    If you don't have "System.Data.OleDb" imported, it needs the full path in the declaration.

    Edit:
    You can set default imports for your solution under Project>>"Name" Properties>>Imports
  4. #3
  5. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Jan 2004
    Location
    Somewhere I belong
    Posts
    1,567
    Rep Power
    45
    Originally Posted by sevenhalo
    If you don't have "System.Data.OleDb" imported, it needs the full path in the declaration.

    Edit:
    You can set default imports for your solution under Project>>"Name" Properties>>Imports
    Yup, that's what it is. Import it in your form (like this: <%@ import Namespace="System.Data.OleDb" %> ) or if you are using Visual Studio, just import it as sevenhalo said.
    Keep it Prodigy, Keep it Real

Similar Threads

  1. User-defined type not defined
    By Beagles in forum Microsoft Access Help
    Replies: 3
    Last Post: September 27th, 2005, 11:40 AM
  2. VBC compiler question
    By torotune in forum .NET Development
    Replies: 3
    Last Post: June 12th, 2005, 10:39 PM
  3. BC30002: Type 'WebForm2' is not defined
    By pobby in forum .NET Development
    Replies: 2
    Last Post: May 13th, 2004, 09:52 AM
  4. BC30002: Type 'WebForm2' is not defined.
    By pobby in forum .NET Development
    Replies: 4
    Last Post: May 13th, 2004, 09:42 AM
  5. Replies: 1
    Last Post: March 26th, 2004, 12:31 PM

IMN logo majestic logo threadwatch logo seochat tools logo