If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to retreive datatype info from Access.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-04, 07:36
holke holke is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
Smile How to retreive datatype info from Access.

Hello,

I like to know if you can retreive column information like
datatype, default_value etc. from Access.

The reason why I want to do this, is that I generate insert and update statements with Vbscript. I need the datatype of the columns to determine if I need to put qoutes around values (in the case of text) or not (in the case of number). In the case of a autonumber datatype, I want the value to be ignored.

I am using Vbscript on IIS to build a dynamic website. I
used to work with Oracle and I could retreive column
information from the datadictionary using SQL e.g.

select column_name
, data_type
from all_columns

How does this work in Access

I suppose you use ADO or DAO. Can anybody tell me which model to use and how to use it to retreive column information?

an example would be nice

Thanx in advance

Holke
..
Reply With Quote
  #2 (permalink)  
Old 01-15-04, 16:11
jcb jcb is offline
Registered User
 
Join Date: Jan 2004
Location: Germany;Lueneburg
Posts: 1
Re: How to retreive datatype info from Access.

Hi Holke,

if you use VB try that one

dim rst
set rst = createobject("ADODB.RECORDSET") 'any version

rst.Open "KundeVertr", strconn

For Each x In rst.Fields
Debug.Print x.Type 'will return a integer which describes a DataTypeEnum fron ADOBD
Next

Hope that helps


Quote:
Originally posted by holke
Hello,

I like to know if you can retreive column information like
datatype, default_value etc. from Access.

The reason why I want to do this, is that I generate insert and update statements with Vbscript. I need the datatype of the columns to determine if I need to put qoutes around values (in the case of text) or not (in the case of number). In the case of a autonumber datatype, I want the value to be ignored.

I am using Vbscript on IIS to build a dynamic website. I
used to work with Oracle and I could retreive column
information from the datadictionary using SQL e.g.

select column_name
, data_type
from all_columns

How does this work in Access

I suppose you use ADO or DAO. Can anybody tell me which model to use and how to use it to retreive column information?

an example would be nice

Thanx in advance

Holke
..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On