Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-05-09 : 10:24:28
|
shashi writes "i have 100 fields in a tablehow to insert values in Access Tablein my table i have 100 fields using vb frontend how to insert values into access tablehow don't know continuation of sql queryplese give me dummy code using 100 fields (dummy fields)" |
|
rrb
SQLTeam Poet Laureate
1479 Posts |
Posted - 2002-05-09 : 22:12:05
|
How many fields in your table? 100 by any chance?You'll need to build an "INSERT" SQL statement as a stringegSQL = "INSERT INTO MyTable ("For i = 1 to 100SQL = SQL & Values(i).FieldName & ","Next iSQL = Left(SQL, Len(SQL)-1) '-strip off last commaSQL = SQL & ") SELECT ("For i = 1 to 100SQL = SQL & Values(i).Value & ","Next iSQL = Left(SQL, Len(SQL)-1) '-strip off last commaSQL = SQL & ")"rst.Open SQL , cnDBetc etc etcSounds a bit like a homework question though....etc etc etc--I hope that when I die someone will say of me "That guy sure owed me a lot of money" |
 |
|
|
|
|