Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

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

Results 1 to 3 of 3
Share This Thread →
  1. #1
    sessie's Avatar
    sessie is offline Contributing User
    Join Date
    Jul 2004
    Location
    staffordshire
    Posts
    280
    Rep Power
    10

    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
    sevenhalo is offline Contributing User
    Join Date
    Nov 2005
    Location
    Canto 34
    Posts
    35
    Rep Power
    9
    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

  3. #3
    ProEdge's Avatar
    ProEdge is offline Contributing User
    Join Date
    Jan 2004
    Location
    Somewhere I belong
    Posts
    1,567
    Rep Power
    45
    Quote 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

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

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

ASP Free Advertisers and Affiliates