Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
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
 
Old January 6th, 2004, 04:20 AM
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with my Insert Statement

I have declared my variables (as below).

Private rsclients As ADODB.Recordset
Const connstr = "Provider=Microsoft.Jet.OLEDB.4.0:data source = f(and then the location of the file)"
Private conn As ADODB.Connection
Private cmdaddnewclient As ADODB.Command
Private required As long
Private sql As String

Then I have

sql = "insert into tblclients (Surname, Firstname, Street, Town, Postcode, Phone, Email, Arrival) Values (?,?,?,?,?,?,?,?)
(I don't know the values until the person presents themselves at reception for check-in)

When I try to run the programme I get a message box 'Compile Error' 'User defined type not defined' on my first variable Private rsclients As ADODB.Recordset (from rs to Recordset highlighted blue).
When I 'remark out' this variable to see what happens the message just move onto the next variable and the next one.

What have I done wrong, or what have I not done?
How do I correct this problem?

Thanks for your help
Brendan

 
Old January 6th, 2004, 08:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sounds like you need to add a reference to the ADO type library. From the VB IDE menu choose Project > References, then in the dialog that appears search for and check "Microsft ActiveX Data Objects x.x Library"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Statement Iashia06 Access 0 April 7th, 2006 12:45 PM
What is wrong with this insert statement? method SQL Server 2000 13 April 27th, 2005 11:46 PM
Problems with my Insert Statement brendan82 Access 1 January 6th, 2004 08:30 AM





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