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 |
|
kev510
Starting Member
5 Posts |
Posted - 2006-07-13 : 14:09:57
|
| Hello everyone. I am a newbie in VBScript, trying to add two variable names together (vColName and i), and then add a value to it at the same time. "i" is a number dynamically changed by "for i = 0 to vColCnt", so that the result will become "vColName1", "vColName2", etc while "FOR NEXT" runs. I've already tried vColCnt = objRecordset.fields.countfor i = 0 to vColCntvColName&i = objRecordset.fields(i).nameNextbut I get a syntax error. Please help! Thanks!! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-07-13 : 15:27:54
|
| [code]vColCnt = objRecordset.fields.countvColName = ""for i = 0 to vColCntIF i= 0 Then vColName = objRecordset.fields(i).nameElse vColName = vColName & ", " & objRecordset.fields(i).nameENd ifNext[/code]Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|