ADO Data Control - What Am I Doing Wrong? 
Author Message
 ADO Data Control - What Am I Doing Wrong?

Hi folks, a newbie here having a horrific time trying to get an ADO data
control to connect to my Oracle database.  I've been following Jeff
McManus's Book, _Database Access with VB 6_ to the letter, I think, but
I *must* be doing something wrong.

I'm trying to get a simple form with an ADO data control linked to a
personnel table, F_PERSONNEL in my Oracle database and have a couple of
text boxes populated with first and last name, WK_FIRST_NAME and
WK_LAST_NAME.  I'm able to do this with an Oracle OO4O data control with
ease, and I can do the same to a Jet database using the VB data
control.  However, with the ADO data control, I get messages saying
"Unable to bind to field or datamember WK_FIRST_NAME" for both text
boxes when the form opens.

There must be something elementary I'm missing, but FWIW, here is what I
do:

1. click on the ado data control (after having selected it from
project-components) and create the control on the form.  I name it
adoData1.

2. right click on the ado data control, choose adodc properties.

3. I've tried both using the ODBC DSN and the Connection string
options.  In both instances, I end up having to select my data source
name.  I do.

4. I fill in the database user name and password in the authetication
tab.

5. On the recordsource tab, I choose 2 - adCmdTable and then the table
name, F_PERSONNEL (I've also tried adCmdtext and adCmdUnknown and
written simple SQL: SELECT * FROM F_PERSONNEL).

6. Created a text box.

7. Set the text box's datasource to the name of the ado control,
adoData1.

8. Set the datafield to WK_FIRST_NAME or whatever - I always get a pick
list of the actual fields in that table, so I know the VB design is
reading the table.

Yet, when the blinking form loads, the message "Unable to bind to field
or datamember 'WK_FIRST_NAME'" appears for every text box.

Help! 8)
--
Tim - http://www.*-*-*.com/ ~tmarshal/
 ^o<  
 /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^  "Want some?" - Ditto



Wed, 09 Mar 2005 05:40:54 GMT  
 ADO Data Control - What Am I Doing Wrong?
Hi there!

Honestly, I don't you're doing anything wrong, but ado controls are often
the source of a whole pack of trouble...  I suggest you do it all using code
instead of adodc.  Here's how:

At the beguinning of your program, declare a connection, such as :
"Public connexion1 as new adodb.connexion"
or such, I don't have the syntax in front of me, but it should look like it.
Use the properties of the connexion to set it up.
After that, declare a recordset variable (you can do it anytime anywhere in
your program, depending on where you want to use it).  It should look like
that:
"public/dim (depending on if you use it in a module or in a form) Recordset1
as new adodb.recordset

From the recordset, you can do alot of things, among others using the
connection string to insert a SQL request to your DB.  Should you have Diane
Zak's vb book it will help you alot.

Hope this helps a bit,
JF


Quote:
> Hi folks, a newbie here having a horrific time trying to get an ADO data
> control to connect to my Oracle database.  I've been following Jeff
> McManus's Book, _Database Access with VB 6_ to the letter, I think, but
> I *must* be doing something wrong.

> I'm trying to get a simple form with an ADO data control linked to a
> personnel table, F_PERSONNEL in my Oracle database and have a couple of
> text boxes populated with first and last name, WK_FIRST_NAME and
> WK_LAST_NAME.  I'm able to do this with an Oracle OO4O data control with
> ease, and I can do the same to a Jet database using the VB data
> control.  However, with the ADO data control, I get messages saying
> "Unable to bind to field or datamember WK_FIRST_NAME" for both text
> boxes when the form opens.

> There must be something elementary I'm missing, but FWIW, here is what I
> do:

> 1. click on the ado data control (after having selected it from
> project-components) and create the control on the form.  I name it
> adoData1.

> 2. right click on the ado data control, choose adodc properties.

> 3. I've tried both using the ODBC DSN and the Connection string
> options.  In both instances, I end up having to select my data source
> name.  I do.

> 4. I fill in the database user name and password in the authetication
> tab.

> 5. On the recordsource tab, I choose 2 - adCmdTable and then the table
> name, F_PERSONNEL (I've also tried adCmdtext and adCmdUnknown and
> written simple SQL: SELECT * FROM F_PERSONNEL).

> 6. Created a text box.

> 7. Set the text box's datasource to the name of the ado control,
> adoData1.

> 8. Set the datafield to WK_FIRST_NAME or whatever - I always get a pick
> list of the actual fields in that table, so I know the VB design is
> reading the table.

> Yet, when the blinking form loads, the message "Unable to bind to field
> or datamember 'WK_FIRST_NAME'" appears for every text box.

> Help! 8)
> --
> Tim - http://www.ucs.mun.ca/~tmarshal/
>  ^o<
>  /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
> /^^  "Want some?" - Ditto



Wed, 16 Mar 2005 20:52:19 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO and SQL: what am I doing wrong ?

2. What am I doing wrong in extrating data

3. Will somebody tell me what I am doing wrong with this ListView Control

4. Referring to controls - What am I doing wrong???

5. Referring to controls - What am I doing wrong???

6. Recordset: What am I doing wrong?

7. What am I doing wrong??

8. What am I doing wrong?

9. Help with syntax. What am I doing wrong

10. What am I doing wrong?

11. What am I doing wrong?

12. What am I doing wrong?

 

 
Powered by phpBB® Forum Software