Hi, Tom--
I'm not sure I'm understanding all of this. I'm getting a syntax error on
this line:
database.SQLexecute('INSERT INTO DBServers SET Networks =
'"+Nthfield(Networks(n),EndOfLine,0)+"' A =
'"+n'"+Nthfield(Networks(n),EndOfLine,0)+ KEY_FIELD =
'"'"+Nthfield(Networks(n),EndOfLine,0)+'"+Nthfield(Networks(n),EndOfLine,0)+
"'")
It doesn't say where, and I'm afraid I can't make heads or tails out of
it...
All My Best,
Jeffrey
on 2/13/07 11:16 PM, Tom Benson <[EMAIL PROTECTED]> wrote:
//Put the contents of you file into a string object called 'data'
Dim In as TextInputStream = file.OpenAsTextFile
Dim data as String = In.Readall
//Loop through data and separate into networks
Dim n,entries as integer
Dim Networks() as string
for n = 0 to countfields(data,"NET:)
Networks.append nthfield(data,"NET:",n)
next
//loop through each network, and insert all entries into the table
for n=0 to ubound(Networks)
for entries = 1 to countfields(Networks(n),EndOfLine) //skip the
first line
database.SQLexecute('INSERT INTO tablename SET Network = '"+Nthfield
(Networks(n),EndOfLine,0)+"' Server = '"+n'"+Nthfield(Networks
(n),EndOfLine,0)+ KEY_FIELD = '"'"+Nthfield(Networks(n),EndOfLine,0)
+'"+Nthfield(Networks(n),EndOfLine,0)+"'")
next
next
//commit the changes to the database
database.commit
The above assumes:
you already have a table set up with columns NETWORK, SERVER and
KEY_FIELD, defined properly to accommodate these strings.
you have already connected to the database called 'database'
The may be quicker ways to do this, but this should work.
- Tom
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>