Results 1 to 7 of 7

object required error

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-01-2014
    Location
    Mysore
    MS-Off Ver
    Excel 2007
    Posts
    379

    object required error

    Dim txt1 As String, txt2 As String
    
    'Set txtSampleTextBox = Controls.Add("Forms.TextBox.1", "txtSampleTB")
    Set rst = CreateObject("adodb.recordset")
    
    
    
           server_name = "192.168.1.200"
        Database_Name = "empdetails" ' Enter your database name here
        User_id = "root" ' enter your user ID here
        Password = "bmx1" ' Enter your password here
        source1 = "emp"
         
        Set conn = New ADODB.Connection
        Set rst = New ADODB.Recordset
    
        conn.ConnectionString = "DRIVER={MySQL ODBC 5.2 unicode Driver};SERVER=" & server_name & ";UID=" & User_id & ";PWD=" & Password & ";DATABASE=" & Database_Name & "; Source=" & source1 & ";"
        conn.Open
        Dim c As ADODB.Connection
    Dim r As ADODB.Recordset
    
    Set c = New ADODB.Connection
    
    Dim rw As Integer
    
    c.Open "DSN=emp"
    
    sq = "Insert into userinfo (employeename,systemname,logindate,logintime, team lead by, project name, allocated work) values ('" & employeename.Value & "','" & systemname.Value & "','" & logindate.Value & "','" & logintime.Value & "','" & TextBox1.Value & "','" & TextBox2.Value & "','" & TextBox3.Value & "')"         -->getting error in this line
    Set r = c.Execute(sq)
    
    c.Close
      
        conn.Close
    
        
        
        Unload Me
        MsgBox "Database Updated!", vbOKOnly, "Update!"
    please help me i am trying to insert data from the userform to mysql database
    Last edited by baig123; 09-08-2014 at 03:08 AM. Reason: paragraph

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  2. Object required error
    By nateisgreat14 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2011, 11:33 AM
  3. Name.Object (Error Object Required)
    By dssrun209 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2010, 01:38 PM
  4. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 PM
  5. Error 424 Object required
    By bdn435 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2007, 08:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1