PROB with "dim as new ADODB...." 
Author Message
 PROB with "dim as new ADODB...."

I just installed Crystal Reports 6.0. The manual reads as follows:

Obtaining a Recordset from the Runtime Data Source

Once you have created the Data Definition File and designed a report
based on that file, you can begin programming your application to obtain
a Recordset or Resultset object from a runtime data source. This data
source can be opened through DAO, RDO, ADO, or the Visual Basic Data
Control. The following tutorial briefly demonstrates how you can obtain
a simple ADO Recordset object.

1) Declare an instance of the ADO Recordset object in your Visual Basic
application. This can be handled in the declarations section of a form
or module.

Dim rs As New ADODB.Recordset

2) Obtain a set of records from an ODBC data source.

rs.Open "SELECT * FROM Customer", "DSN=Xtreme sample data;",
adOpenKeyset

--This is what I'd like to do, but when I do Step 1 (above), I get this
error message:

"User-Defined Type Not Defined"

Somebody please tell me what I'm doing wrong....
Thanks



Thu, 30 Aug 2001 03:00:00 GMT  
 PROB with "dim as new ADODB...."
Did you reference the Actives Data Library?

Project->References->then select Microsoft ActiveX Data Object 2.0 Library

Quote:

>I just installed Crystal Reports 6.0. The manual reads as follows:

>Obtaining a Recordset from the Runtime Data Source

>Once you have created the Data Definition File and designed a report
>based on that file, you can begin programming your application to obtain
>a Recordset or Resultset object from a runtime data source. This data
>source can be opened through DAO, RDO, ADO, or the Visual Basic Data
>Control. The following tutorial briefly demonstrates how you can obtain
>a simple ADO Recordset object.

>1) Declare an instance of the ADO Recordset object in your Visual Basic
>application. This can be handled in the declarations section of a form
>or module.

>Dim rs As New ADODB.Recordset

>2) Obtain a set of records from an ODBC data source.

>rs.Open "SELECT * FROM Customer", "DSN=Xtreme sample data;",
>adOpenKeyset

>--This is what I'd like to do, but when I do Step 1 (above), I get this
>error message:

>"User-Defined Type Not Defined"

>Somebody please tell me what I'm doing wrong....
>Thanks



Thu, 30 Aug 2001 03:00:00 GMT  
 PROB with "dim as new ADODB...."
Gary
No, should I? Mine references Microsoft ActiveX Data Object 1.5 Library.
Should I upgrade? Thanks
Rick
Quote:

> Did you reference the Actives Data Library?

> Project->References->then select Microsoft ActiveX Data Object 2.0 Library


> >I just installed Crystal Reports 6.0. The manual reads as follows:

> >Obtaining a Recordset from the Runtime Data Source

> >Once you have created the Data Definition File and designed a report
> >based on that file, you can begin programming your application to obtain
> >a Recordset or Resultset object from a runtime data source. This data
> >source can be opened through DAO, RDO, ADO, or the Visual Basic Data
> >Control. The following tutorial briefly demonstrates how you can obtain
> >a simple ADO Recordset object.

> >1) Declare an instance of the ADO Recordset object in your Visual Basic
> >application. This can be handled in the declarations section of a form
> >or module.

> >Dim rs As New ADODB.Recordset

> >2) Obtain a set of records from an ODBC data source.

> >rs.Open "SELECT * FROM Customer", "DSN=Xtreme sample data;",
> >adOpenKeyset

> >--This is what I'd like to do, but when I do Step 1 (above), I get this
> >error message:

> >"User-Defined Type Not Defined"

> >Somebody please tell me what I'm doing wrong....
> >Thanks



Thu, 30 Aug 2001 03:00:00 GMT  
 PROB with "dim as new ADODB...."
Don't use the NEW command when you dim you recordset. Thats not good. Use:

Dim rs as adodb.recordset

also I noted that you forget to set the recordset:

Set rs = new adodb.recordset

Good luck!

Matt

    I just installed Crystal Reports 6.0. The manual reads as follows:
    Obtaining a Recordset from the Runtime Data Source

    Once you have created the Data Definition File and designed a report
based on that file, you can begin programming your application to obtain a
Recordset or Resultset object from a runtime data source. This data source
can be opened through DAO, RDO, ADO, or the Visual Basic Data Control. The
following tutorial briefly demonstrates how you can obtain a simple ADO
Recordset object.

    1) Declare an instance of the ADO Recordset object in your Visual Basic
application. This can be handled in the declarations section of a form or
module.

    Dim rs As New ADODB.Recordset

    2) Obtain a set of records from an ODBC data source.

    rs.Open "SELECT * FROM Customer", "DSN=Xtreme sample data;",
adOpenKeyset

    --This is what I'd like to do, but when I do Step 1 (above), I get this
error message:

    "User-Defined Type Not Defined"

    Somebody please tell me what I'm doing wrong....
    Thanks



Fri, 31 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PROB with "dim as new ADODB...."

2. PROB with "dim as new ADODB...."

3. dynamically dim a variable ie dim "variable"&n

4. redundant New: Dim rs As New ADODB.Recordset

5. prob: menu "addressbook" in Word-Dialog

6. Prob: IE + onBlur="window.focus()"

7. Prob....RegQueryValue "Internet Explorer"

8. "late" DIM statements

9. Problem with "Dim as Field"

10. "Un-dim" Array

11. What is "Dim X%"?

12. Problem with "Dim as Field"

 

 
Powered by phpBB® Forum Software