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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Help

Status
Not open for further replies.

Hungoverhippie

Programmer
Feb 7, 2002
11
0
0
US
Ok theres got to be away to do this,

reading from a text File and the lines read

rst1.fields("test")
rst1.fields("test2")

I read these into an array then I do my select statement and Open from my sql database no problem but then how can i assign from my recordset that is returned

a$ = array(1)

I get a$ = "rst1.fields("test")"
I want a$ to read the literal from array(1) as in the field info in rst1.fields("test")

Hope this makes since...

Thanks In Advance
HungOverHippie
 
you should be able to pull the field names out of your loaded array easily enough

the real question is wether or not your recordset objects are going to use the same name as the recordset text name you get from the file

ex.

read from file assign to an array named x()

a$=recordSet.fields(getFieldName(x(1))

use this function to get field name
Public Function getFieldName(incomingStr As String) As String

Dim ret1 As Long
Dim ret2 As Long

ret1 = InStr(1, incomingStr, Chr(34))
ret2 = InStr(ret1 + 1, incomingStr, Chr(34))
getFieldName = Mid(incomingStr, ret1 + 1, (ret2 - ret1) - 1)

End Function

then just do your assignment statement



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top