Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 4th, 2006, 06:05 AM
Authorized User
Join Date: Mar 2006
Location: London, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Method or data member not found

I m new with VB. I m trying to add data from VB interface to Microsoft access. But its showing "Compiler error: Method or data member not found" error.n its highlighted at Private Sub cmdOk_Click()

My code is as follows:

Private Sub cmdOk_Click()
Dim rs As New ADODB.Recordset
Dim sql As String
On Error GoTo errorhandler

if anyone could help me with this, i would really appreciate.

sql = "insert into StudentProfile values ('" & txtID.Text & "','" & txtDob.Text & "','" & cmbTitle.Text & "','" & txtFname.Text & "','" & txtMname.Text & "','" & txtLname.Text & "','" & cmbGender.Text & "','" & txtNationality.Text & "','" & txtHouseNo.Text & "','" & txtStreet.Text & "','" & txtCity.Text & "','" & txtPoCo.Text & "')"

If isValid = 1 Then
  mdldb.conn.Execute (sql)
  txtID.Text = txtID.Text + 1
End If
Exit Sub
   MsgBox Err.Description
  #2 (permalink)  
Old March 6th, 2006, 03:32 PM
Friend of Wrox
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts

that is odd. I am wondering if there is something "before" that line that is causing the error. Can you post some of the previous the lines? Do you have Option Explicit? How is mdldb declared?

BTW try running with a full compile (Ctrl+F5), you get compile errors right away and usually they are more descriptive


Similar Threads
Thread Thread Starter Forum Replies Last Post
complile error : method or data member not found! Tasha Access VBA 6 May 1st, 2007 03:49 PM
Method or Data Member not Found Related to Crystal ishqvj Beginning VB 6 0 November 29th, 2006 03:49 AM
Method or Data member not found Anup Gavate VB How-To 2 March 25th, 2005 04:50 PM
LoadFrom Invoke Member... Method not found DolphinBay VB.NET 2002/2003 Basics 1 April 29th, 2004 10:01 AM
LoadFrom Invoke Member... Method not found DolphinBay ASP.NET 1.0 and 1.1 Basics 0 April 29th, 2004 09:29 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.