DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 8 of 8

Thread: data type

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    data type

    [Originally posted by jimmy6]

    when i type the following code,the error will occur that say undefined datatype.can˙ you help me to solve this problem?
    dim a as database

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:data type

    [Originally posted by Nick]

    make sure you have reference to Microsoft Access Object Library.

    to do this go to the menu bar>Project>references>

    then look for
    Microsoft Access 9 Object Library or whatever version you have. mines MSACC9.OLB

    then give it a go. Let me know what happens
    nick

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:data type

    [Originally posted by Chris Carta]

    Do what Nick says, also, make sure your intellisense is participating.˙ When you want an ADODB.Database,˙ then the intellisense should be poping that up.˙ If you have several database references (DAO & ADODB) then maybe the compiler is getting mixed up with the .database part and doesn't know which access method you want (DAO or ADODB).˙ Try fully qualifying the database with DAO.Database OR ADODB.Database.

    Hope that help,
    Chris

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:data type

    [Originally posted by jimmy6]

    sorry chris ,actaully i do not know what is ADODB and DAO.if u not mind,explain me me ok?

  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:data type

    [Originally posted by Jessica Osborne]

    ADODB is a way of connecting to a database.
    In order to create a connection to a databse you must create a connection object, a connection string and a recordset object if you want to retrieve records from a databse.

    Dim adoConection as ADODB.Connection
    Dim adoRecordset as ADODB.Recordset
    Dim sConnectionString as String

    To instantiate these objects you must Set them:

    Set adoConnection = new ADODB.Connection
    Set adoRecordset = new ADODB.Recordset

    then you must connect to your database:

    sConnectionString = "Source....ect...

    You can create a database object in the same way:

    Dim adoDatabase as ADODB.Database
    Set adoDatabase = new ADODB.Database

    Then use your recordset to retrieve information from your database if you so desire.

  6. #6
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:data type

    [Originally posted by Chris Carta]

    If memory serves me correctly, DAO stands for Database Access Object and ADODB stands for ActiveX Database Objects (db).

    If both are selected under the menu picks of Project/References, then when you want .Recordset, you will see two entries in the intellisense listbox.

    Before I go any further, maybe you could copy and paste your .VBP as seen from notepad.exe.

    That way I could tell you if you have a reference to both.

    It's been some heavy coding since I first replied and it's been a long day, so you copy the .VBP and I'll reply again tomorrow.
    Chris

  7. #7
    Join Date
    Aug 2004
    Posts
    43,023

    chris this is my .VBP

    [Originally posted by jimmy6]

    Type=Exe
    Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\SYSTEM\STDOLE2.TLB#OLE Automation
    Reference=*\G{00025E01-0000-0000-C000-000000000046}#4.0#0#..\..\..\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\DAO\DAO350.DLL#Microsoft DAO 3.51 Object Library
    Reference=*\G{642AC760-AAB4-11D0-8494-00A0C90DC8A9}#1.0#0#..\..\SYSTEM\MSDBRPTR.DLL#Microsoft Data Report Designer v6.0
    Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\SYSTEM\MSSTDFMT.DLL#Microsoft Data Formatting Object Library
    Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX
    Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX
    Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; MSDATGRD.OCX
    Reference=*\G{00000200-0000-0010-8000-00AA006D2EA4}#2.0#0#..\..\..\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\msado20.tlb#Microsoft ActiveX Data Objects 2.0 Library
    Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX
    Object={20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0; MSMAPI32.OCX
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
    Form=frmlogin.frm
    Form=frmpatientregister.frm
    Form=frmpassword.frm
    Form=frmpatientadd.frm
    Form=frmpatientmedical.frm
    Module=Module1; clinic.bas
    Module=Module2; Module2.bas
    Form=frmdelete.frm
    Form=frmmainmenu.frm
    Form=frmmc.frm
    Form=frmreceipt.frm
    Form=frmeditmedicine.frm
    Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\SYSTEM\MSBIND.DLL#Microsoft Data Binding Collection
    Object={0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0; MSHFLXGD.OCX
    Reference=*\G{7C0FFAB0-CD84-11D0-949A-00A0C91110ED}#1.0#0#..\..\SYSTEM\msdatsrc.tlb#Microsoft Data Source Interfaces
    Form=frmdispense.frm
    Form=frmpatientrecord.frm
    Form=frmmedicinerecord.frm
    Form=frmeditpcompany.frm
    Form=a.frm
    Object={E179B26F-FC25-11D1-9915-006097C99385}#1.0#0; GRIDDTC.OCX
    Object={8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0; MSCAL.OCX
    Object={65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0; MSCHRT20.OCX
    Form=frmoverallreport.frm
    Form=frmpatientedit.frm
    Form=frmpinvois.frm
    Form=frmpcrecord.frm
    Reference=*\G{3D5C6BF0-69A3-11D0-B393-00A0C9055D8E}#1.0#0#..\..\..\PROGRAM FILES\COMMON FILES\DESIGNER\MSDERUN.DLL#Microsoft Data Environment

  8. #8
    Join Date
    Aug 2004
    Posts
    43,023

    Re:chris this is my .VBP

    [Originally posted by Chris Carta]

    As I suspected.˙ There is a reference to BOTH "Data Access Objects" (DAO) and "ActiveX Data Objects" (ADOdb).

    Both of these references have "Database" as an object.˙ Therefore, if you try and set the ADODB.Database when in fact the DAO.Database object is being referenced, there could be a type mismatch.˙ The way around this is to NOT use code like "Set x = Database", instead use "Set x = ADODB.Database".

    I hope I'm on to what your problem is and this helps.˙ If not, sorry for the waste of time.

    Check it out and let us know.˙ If this is unclear, (now that I know what's in the project), send the line of code which bombs.

    Chris

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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links