| || |
Compare Data with DBTable.Compare
1. I have an Excel Sheet which contains no. of columns and rows.
(UserId, FName, LName).
Now what my script does is that it reads all the records from the file and inserts it into the webpage in (userid,fname,last) fields.
But, what I want to do is that before it fills out the fields I want to compare the userID to see if it exists in the DBTable.
and if it does, then compare the next value and so on,
and only fill in the fields when they don't exist in the DBTable.
DB Table (contains they fields as well and has records in it)
Also, I want to exit the loop after it find the FIRST Record that doesn't match in DB (which will be inserted into the fields).
the reason being is that UserID's are UNIQUE in the Database, if it continues on grabbing the existing userids there will be an duplicate keys (error).
How do I do that? Didn't seem to work what I had tried out.
Please help me on this!!!
here is the sample code what i was trying do...
Set Driver = DDT.ExcelDriver("C:\TBook.xls","TC")
If (Driver.Value(0) <> DBTables.Delivery_SQL.Compare()) Then
' call Test1 sub and pass values.
ShowMessage("Second IF Statement")
Loop Until Driver.EOF
Re: Compare Data with DBTable.Compare
As for breaking out of loops, this is the reason I hate VBScript. It doesn't have any clear break; or continue; statements.
I think in your case you can insert an 'exit do' statement to break out of the loop.