|
-
Mar 11th, 2004, 09:17 AM
#1
Thread Starter
Hyperactive Member
DataBase RESOLVED
VB Code:
dim a as adodb.recordset
Dim usersDB As ADODB.Connection
Private Sub Form_Load()
Set usersDB = New ADODB.Connection
usersDB.Open "dsn=DATABASENAME;"
Set a = New ADODB.Recordset
usersDB.Execute ("update FIELDNAME where)
'a.fields(number) I know that this line gives me the value of the
'field however i don't know how i can find the field's name
'lets say that i want to print all of my table's fieldls' names
'in a loop How can i do this? i want to use it to update many cells
'as shown above (FIELDNAME)
Thank you,
Blacknight
Last edited by Blacknight; Mar 11th, 2004 at 10:40 AM.
-
Mar 11th, 2004, 09:30 AM
#2
Frenzied Member
Re: DataBase
Hard to see your actual question when you use it as remarks in your code.
-
Mar 11th, 2004, 09:41 AM
#3
Thread Starter
Hyperactive Member
lol, just want to know how i can print in a loop all my table fields' names
-
Mar 11th, 2004, 09:41 AM
#4
Fanatic Member
This loads the db field names into a treeview - you can modify it to suit your needs. targetDB in the cn.Open line would be the name of your database.
VB Code:
' Clear the TreeView.
trvTarget.Nodes.Clear
'open connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & targetDB & ";Persist Security Info=False"
'set recordset to database schema
Set rs = cn.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "Table"))
'loop through recordset and list all tables in the treeview
Do While Not rs.EOF
Set table_node = trvTarget.Nodes.Add(, , , _
rs!TABLE_NAME)
table_node.Tag = "Table"
rs.MoveNext
Loop
-
Mar 11th, 2004, 09:48 AM
#5
Thread Starter
Hyperactive Member
what is trvTarget?
is that a recordset?
also i am not sure you understood what i want; i want to print all field names in a specific table, not all my table's names
-
Mar 11th, 2004, 10:02 AM
#6
Thread Starter
Hyperactive Member
never mind, problem solved!
i just write recordset.fields(number).name
thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|