That would work, here is another way to skin the same cat:
sql = "SELECT TOP 1 [idFieldName] FROM [tbleName] ORDER BY [idFieldName] DESC;"
BTW: Use trailing semi colons at the end of your SQL. This is not required but very Recommended. This explicitly terminates the statement and helps prevent SQL injections:
TIP: Place your sql language posts in the SQL area of the forum for the best possible solution.
Wind is your friend
Matt
|