Click to See Complete Forum and Search --> : ADO Syntax


George1111
November 5th, 2007, 09:04 AM
I have just found a few examples like

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.Open "AllMovies", strConnect, adOpenStatic, AdLockReadOnly, adCmdTable

I have been using

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "AllMovies", strConnect, adOpenStatic, AdLockReadOnly


What is the purpose of the adCmdTable parameter

Thanks

davide++
November 5th, 2007, 11:54 AM
Hi all.

The first parameter of Open method is a command object, eg a valid SQL object, for example the name of a table, a SELECT statement, a stored procedure and so on (remember that using ADO you can connect to various database). The last parameter, called "option" in ADO documentation, says the type of object passed by the first parameter: in your case adCmdTable points out that AllMovies is a table.
If you don't specify the option parameter the performance will decrease, because the db server has to "investigate" about the kind of command.