p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

activex_data_objects thread: how to get information on the fields of a database


Message #1 by "yinmos" <yinmos@y...> on Wed, 21 Nov 2001 17:30:16
Hi,



I need to know more information on the fields of a database. How can i do 

that?



I need to insert some data into a field in a table but found out that this 

cannot be done. I have to insert to other fields as well. The problem is i 

do not have any information on the fields at run time. So error occurs.



I need to know the following informations :

->whether is the field a primary key field?

->whether is the field a required fields?

->what is the data type of the field?



Also i have notice that some field are auto increament and does not allow 

inserting of data.



How can i get all these information at runtime?



Message #2 by KRISHNA VADDADI <krishnavaddadi@y...> on Thu, 22 Nov 2001 23:40:11 -0800 (PST)
Hi 

If in case u are using ADO recordset objects then u

have all the options of finding the database recordset

property

for example

dim fldTemp  as Field

For Each fldTemp In mrsFill.Fields

'THIS IS FOR CREATING THE NEW RECORDSET WITH DEFINED

OR OBTAINED ORIGINAL RECORDSET

.Fields.Append fldTemp.Name, fldTemp.Type,

fldTemp.DefinedSize



'TO FIND OUT THE DATATYPE

debug.print 

fldTemp.DefinedSize

        Next

--- yinmos <yinmos@y...> wrote:

> Hi,

> 

> I need to know more information on the fields of a

> database. How can i do 

> that?

> 

> I need to insert some data into a field in a table

> but found out that this 

> cannot be done. I have to insert to other fields as

> well. The problem is i 

> do not have any information on the fields at run

> time. So error occurs.

> 

> I need to know the following informations :

> ->whether is the field a primary key field?

> ->whether is the field a required fields?

> ->what is the data type of the field?

> 

> Also i have notice that some field are auto

> increament and does not allow 

> inserting of data.

> 

> How can i get all these information at runtime?

> 

> 

> ---

> You are currently subscribed to activex_data_objects

> as: krishnavaddadi@y...


> $subst('Email.Unsub')

> 





__________________________________________________

Do You Yahoo!?

Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.

http://geocities.yahoo.com/ps/info1

Message #3 by Thomas Bellavia <TBellavia@V...> on Wed, 28 Nov 2001 09:55:56 -0500
Using ADO you can open a schema using Connection.OpenSchema('enumerator')

with various enumerators and check all the entries...



-----Original Message-----

From: yinmos [mailto:yinmos@y...]

Sent: Wednesday, November 21, 2001 12:30 PM

To: ActiveX_Data_Objects

Subject: [activex_data_objects] how to get information on the fields of

a database





Hi,



I need to know more information on the fields of a database. How can i do 

that?



I need to insert some data into a field in a table but found out that this 

cannot be done. I have to insert to other fields as well. The problem is i 

do not have any information on the fields at run time. So error occurs.



I need to know the following informations :

->whether is the field a primary key field?

->whether is the field a required fields?

->what is the data type of the field?



Also i have notice that some field are auto increament and does not allow 

inserting of data.



How can i get all these information at runtime?







tbellavia@v...


$subst('Email.Unsub')


  Return to Index