![]() |
rs.open Conn, adOpenDynamic, adLockOptimistic, adCmdTable
Is the rs.open line correct?
function GetNextOrderID() dim Cmd dim rs cmd = "SELECT MAX(orderID) AS LastID FROM itemsOrdered rs.open Conn, adOpenDynamic, adLockOptimistic, adCmdTable GetNextOrderID = VAL(0 & rs("LastID")) + 1 end function |
Quote:
function GetNextOrderID() dim Cmd dim rs cmd = "SELECT MAX(orderID) AS LastID FROM itemsOrdered set rs = Server.CreateObject("ADODB.Connection") rs.open Cmd, Conn, adOpenDynamic, adLockOptimistic, adCmdText GetNextOrderID = VAL(0 & rs("LastID")) + 1 end function |
rs.open line is wrong I think (I've been wrong before). The Select should be pointing to the table, not the file so take a look at the functions in the UDf to see how to handle that.
|
| All times are GMT +1. The time now is 11:06 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.