Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabledef problem in VBScript. 1

Status
Not open for further replies.

JonMa

Programmer
Jul 16, 2003
69
NO
Hello all good helpers.
I am trying to find out which attributes a field have in any database, so I can avoid insert on that field.
However I do not know how to connect to a tabledef object in vbscript. The code below will not work because of the line "Set tdf = db.TableDefs("Person")".
Is there some connection missing to an object and how can I do it?

Set db = CreateObject("ADODB.Connection")
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\asp\jon\Korps.mdb"

Set tdf = db.TableDefs("Person")
Set fld = tdf.Fields("KorpsID")
Msgbox fld.Attributes

Kindly Regards.
 
You are attempting to use DAO code with ADO. You can open the ADO help file "ADO210.CHM" normally in the Windows Help directory to view the object model.

Duane
MS Access MVP
 
Hello.
Thank you for your suggestion.
I have tried to understand it, but I am still lost.
Please help.
 
Maybe if we knew what you were attempting to do, someone could help. Is the a reason you are using vbscript? Are you aware there is a Tek-tips vbscript forum?

Duane
MS Access MVP
 
Hello Dhookom.
Thank you for the answer.
As you can see I try to get attributes from a field in an access dagabase. No reason for vbscript, but that is what I have been using so far. I have only VBScript forum has not been able to help me. I only have Visual basic 5.0 CCE (using components) installed on my machine.
Kind regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top