Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB

Status
Not open for further replies.

aliiiish

Programmer
Dec 19, 2005
13
CA
Hi Guys,

It is the first time I use ADO and I cannot really understand how the batch size in this code is being calculated....A brief description would really be helpful.

<%
dim nBatchSize

strSQL = "SELECT setting_value FROM _setting WHERE Setting_Name = 'Interface_Installed'"
SET rsINSTALLED = CreateObject("ADODB.Recordset")
rsINSTALLED.Open strSql, Session("sConnect")

if rsINSTALLED("setting_value") = 0 then
strSQL = "UPDATE Interface_Export SET Path = '\\' + @@SERVERNAME + '\web\mfs\Interface\Files\'"
SET rsUPDATE = CreateObject("ADODB.Recordset")
rsUPDATE.Open strSql, Session("sConnect")

strSQL = "UPDATE _setting SET setting_value = 1 WHERE Setting_Name = 'Interface_Installed'"
SET rsUPDATE = CreateObject("ADODB.Recordset")
rsUPDATE.Open strSql, Session("sConnect")
end if

' New Setting for batch size.
strSQL = "SELECT setting_value FROM _setting WHERE Setting_Name = 'Interface_Out_Batch_Size'"
SET rsBATCHSIZE = CreateObject("ADODB.Recordset")
rsBATCHSIZE.Open strSql, Session("sConnect")

if rsBATCHSIZE.BOF and rsBATCHSIZE.EOF then

' This will setup the batch size if the setting value is missing.
strSQL = "INSERT INTO _setting(Setting_Name, Setting_Value) VALUES('Interface_Out_Batch_Size', 2000) "
SET rsINSERTBATCHSIZE = CreateObject("ADODB.Recordset")
rsINSERTBATCHSIZE.Open strSql, Session("sConnect")

nBatchSize = 2000
else
nBatchSize = cLng(rsBATCHSIZE("setting_value"))
end if

strSQL="SELECT * FROM Interface_Export_Type WHERE Interface_ID = " & request("sType")
SET rsEI = CreateObject("ADODB.Recordset")
rsEI.Open strSql, Session("sConnect")
%>
 
This seems like a strange thing to do the first time you use ADO ...

What exactly are you trying to accomplish? (big picture)
 
I want to know how the nbatchsize is calculated
 
It isnt really calculated in this code.

The code attempts to fetch the value out of the database but if it is not found the code uses two thousand as a default value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top