Multiple inserts

  • magyar - i just wanted to explain the syntax I was asking you to use...

    eg: the next 6 lines of code:

    MyParam.Name = "@SRschoolNameFirst"

    MyParam.Value = SRschoolNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    ....can be replaced with:

    .Parameters.append.CreateParameter("@SRschoolNameFirst", adVarChar, adParamInput,150,SRschoolNameFirst)...

    then again, as remi says, he already has the whole thing written out for you...so it's ready to use!

    but next time round when you want to minimise on typing/# of code lines etc..you could use this(i'm a minimalist you see...







    **ASCII stupid question, get a stupid ANSI !!!**

  • "you could use this(i'm a minimalist you see...

    "

    Why is it that the bigest brightest and best always claim to be minimalist.?

    Mgyar anyone who has been programming for awhile and claims to never have cut and pasted code is Liar Liar pants on fire. If you read the code you are pasting you will in time understand why it works. Slap your forhead and say AH now I see. Relax and enjoy the quick fix.

    Mike

  • "I don't like to just copy and paste, I want to understand the theory behind it."...

    mike - in magyar's defense - what was meant by this was...sure I'll just copy and paste...provided I understand what I'm copying and pasting....







    **ASCII stupid question, get a stupid ANSI !!!**

  • Sushila,  thanks, that is what I meant.  I do copy & paste all time!

     

     

  •  

    Hi Remi....

    I spent the weekend trying to get the big insert asp page to work, but it keeps giving me a 'page cannot be displayed' error when I hit 'submit' on the final form page.

    Here is the big_insert.asp  script:

     

    <%

    <!--- #include file="..path/adovbs.inc" -->

    Dim MyCn

    Set MyCn = Server.CreateObject("ADODB.Connection")

    Set MyCmd = Server.CreateObject("ADODB.Command")

    MyCn.Open = "DSN=OSUNet;UID=xxxx;PWD=xxxxxxxx"

    Set MyCMd.ActivateConnection = MyCn

    MyCmd.CommandType = adCmdStoredProc

    MyCmd.CommandText = "dbo.sp_biginsert"

    MyCmd.Execute

    Dim MyCmd As ADODB.Command

    SET MyCmd = SERVER.CREATEOBJECT ("ADODB.Command")

    MyCmd.CommandText = "dbo.sp_biginsert"

    MyCmd.CommandType = adCmdStoredProc

    Dim MyParam As ADODB.Parameter

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Direction = adParamReturnValue

    MyParam.Name = "@Return"

    MyParam.Type = adInteger

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrequestDate"

    MyParam.Value = SRrequestDate

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolNameFirst"

    MyParam.Value = SRschoolNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolNameLast"

    MyParam.Value = SRschoolNameLast

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolCompany"

    MyParam.Value = SRschoolCompany

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolBranch"

    MyParam.Value = SRschoolBranch

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolAddress1"

    MyParam.Value = SRschoolAddress1

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolAddress2"

    MyParam.Value = SRschoolAddress2

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolCity"

    MyParam.Value = SRschoolCity

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolState"

    MyParam.Value = SRschoolState

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolZip"

    MyParam.Value = SRschoolZip

    MyParam.Size = 20

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolPhone"

    MyParam.Value = SRschoolPhone

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolFax"

    MyParam.Value = SRschoolFax

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolEmail"

    MyParam.Value = SRschoolEmail

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolRegion"

    MyParam.Value = SRschoolRegion

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolSupervisor"

    MyParam.Value = SRschoolSupervisor

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolclaimType"

    MyParam.Value = SRschoolclaimType

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolDateOfLoss"

    MyParam.Value = SRschoolDateOfLoss

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolInsured"

    MyParam.Value = SRschoolInsured

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolClaimNumber"

    MyParam.Value = SRschoolClaimNumber

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolPackaging"

    MyParam.Value = SRschoolPackaging

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRschoolContactPrefs"

    MyParam.Value = SRschoolContactPrefs

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantNameFirst"

    MyParam.Value = SRclaimantNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantNameMiddle"

    MyParam.Value = SRclaimantNameMiddle

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantNameLast"

    MyParam.Value = SRclaimantNameLast

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantOffice"

    MyParam.Value = SRclaimantOffice

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantAddress1"

    MyParam.Value = SRclaimantAddress1

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantAddress2"

    MyParam.Value = SRclaimantAddress2

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantCity"

    MyParam.Value = SRclaimantCity

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantState"

    MyParam.Value = SRclaimantState

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantZip"

    MyParam.Value = SRclaimantZip

    MyParam.Size = 20

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantPhone"

    MyParam.Value = SRclaimantPhone

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantDateOfBirth"

    MyParam.Value = SRclaimantDateOfBirth

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantSSN"

    MyParam.Value = SRclaimantSSN

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantSex"

    MyParam.Value = SRclaimantSex

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantMaritalStatus"

    MyParam.Value = SRclaimantMaritalStatus

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantSpouse"

    MyParam.Value = SRclaimantSpouse

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantChildrenNum"

    MyParam.Value = SRclaimantChildrenNum

    MyParam.Size = 15

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantChildrenAges"

    MyParam.Value = SRclaimantChildrenAges

    MyParam.Size = 25

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantRace"

    MyParam.Value = SRclaimantRace

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantHeightLow"

    MyParam.Value = SRclaimantHeightLow

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantHeightHigh"

    MyParam.Value = SRclaimantHeightHigh

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantWeightLow"

    MyParam.Value = SRclaimantWeightLow

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantWeightHigh"

    MyParam.Value = SRclaimantWeightHigh

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantSpecialChar"

    MyParam.Value = SRclaimantSpecialChar

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantOccupation"

    MyParam.Value = SRclaimantOccupation

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantInjury"

    MyParam.Value = SRclaimantInjury

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantRestrictions"

    MyParam.Value = SRclaimantRestrictions

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantRepresented"

    MyParam.Value = SRclaimantRepresented

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantVehicle1Make"

    MyParam.Value = SRclaimantVehicle1Make

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantVehicle1Model"

    MyParam.Value = SRclaimantVehicle1Model

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantVehicle1Tag"

    MyParam.Value = SRclaimantVehicle1Tag

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantVehicle2Make"

    MyParam.Value = SRclaimantVehicle2Make

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantVehicle2Model"

    MyParam.Value = SRclaimantVehicle2Model

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRclaimantVehicle2Tag"

    MyParam.Value = SRclaimantVehicle2Tag

    MyParam.Size = 75

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRsubjectEmployer"

    MyParam.Value = SRsubjectEmployer

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerNameFirst"

    MyParam.Value = SREmployerNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerNameLast"

    MyParam.Value = SREmployerNameLast

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerAddress1"

    MyParam.Value = SREmployerAddress1

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerAddress2"

    MyParam.Value = SREmployerAddress2

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerCity"

    MyParam.Value = SREmployerCity

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerState"

    MyParam.Value = SREmployerState

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerZip"

    MyParam.Value = SREmployerZip

    MyParam.Size = 20

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerPhone"

    MyParam.Value = SREmployerPhone

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerContact"

    MyParam.Value = SREmployerContact

    MyParam.Size = 3

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SREmployerInfo"

    MyParam.Value = SREmployerInfo

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeNameFirst"

    MyParam.Value = SRcollegeNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeNameLast"

    MyParam.Value = SRcollegeNameLast

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeAddress1"

    MyParam.Value = SRcollegeAddress1

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeAddress2"

    MyParam.Value = SRcollegeAddress2

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeCity"

    MyParam.Value = SRcollegeCity

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeState"

    MyParam.Value = SRcollegeState

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeZip"

    MyParam.Value = SRcollegeZip

    MyParam.Size = 20

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegePhone"

    MyParam.Value = SRcollegePhone

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeCopyOnReports"

    MyParam.Value = SRcollegeCopyOnReports

    MyParam.Size = 3

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeContact"

    MyParam.Value = SRcollegeContact

    MyParam.Size = 3

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcollegeInfo"

    MyParam.Value = SRcollegeInfo

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabCompany"

    MyParam.Value = SRrehabCompany

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabNameFirst"

    MyParam.Value = SRrehabNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabNameLast"

    MyParam.Value = SRrehabNameLast

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabAddress1"

    MyParam.Value = SRrehabAddress1

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabAddress2"

    MyParam.Value = SRrehabAddress2

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabCity"

    MyParam.Value = SRrehabCity

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabState"

    MyParam.Value = SRrehabState

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabZip"

    MyParam.Value = SRrehabZip

    MyParam.Size = 20

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabPhone"

    MyParam.Value = SRrehabPhone

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabContact"

    MyParam.Value = SRrehabContact

    MyParam.Size = 3

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRrehabInfo"

    MyParam.Value = SRrehabInfo

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingNameFirst"

    MyParam.Value = SRbuildingNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingNameLast"

    MyParam.Value = SRbuildingNameLast

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingAddress1"

    MyParam.Value = SRbuildingAddress1

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingAddress2"

    MyParam.Value = SRbuildingAddress2

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingCity"

    MyParam.Value = SRbuildingCity

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingState"

    MyParam.Value = SRbuildingState

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingZip"

    MyParam.Value = SRbuildingZip

    MyParam.Size = 20

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingPhone"

    MyParam.Value = SRbuildingPhone

    MyParam.Size = 35

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingContact"

    MyParam.Value = SRbuildingContact

    MyParam.Size = 3

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbuildingInfo"

    MyParam.Value = SRbuildingInfo

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRreason"

    MyParam.Value = SRreason

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRobjective1"

    MyParam.Value = SRobjective1

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRobjective2"

    MyParam.Value = SRobjective2

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRobjective3"

    MyParam.Value = SRobjective3

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbudgetAmount"

    MyParam.Value = SRbudgetAmount

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRsingleDaySurv"

    MyParam.Value = SRsingleDaySurv

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRsceneInvestigation"

    MyParam.Value = SRsceneInvestigation

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRactivityCheck"

    MyParam.Value = SRactivityCheck

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRresidencyCheck"

    MyParam.Value = SRresidencyCheck

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRmultidaySurv"

    MyParam.Value = SRmultidaySurv

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRstatement"

    MyParam.Value = SRstatement

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRbackgroundCheck"

    MyParam.Value = SRbackgroundCheck

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRwidowCheck"

    MyParam.Value = SRwidowCheck

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRhospitalCanvass"

    MyParam.Value = SRhospitalCanvass

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRdueDate"

    MyParam.Value = SRdueDate

    MyParam.Size = 50

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRcomments"

    MyParam.Value = SRcomments

    MyParam.Size = 500

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

    MyCmd.Parameters.Append MyParam

    MyCn.Open

    MyCmd.ActiveConnection = MyCn

    MyCmd.Execute exec_sp_biginsert

    MyCn.Close

    ReturnValue = CInt(MyCmd.Parameters("@Return").Value)

    Set MyParam = Nothing

    Set MyCmd = Nothing

    %>

  • Adding a parameter is done with

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Command")

    MyParam.Name = "@SRhospitalCanvass"

    MyParam.Value = SRhospitalCanvass

    MyParam.Size = 10

    MyParam.Direction = adParamInput

    MyParam.Type = adChar

    MyCmd.Parameters.Append MyParam

    This can be done in one line like to reduce no of lines and it will be easy to maintain.

    MyCmd.Parameters.Append MyCmd.CreateParameter("Name", "Type","direction","size","Value")

    Regards,
    gova

  • Dim MyCmd As ADODB.Command

    Dim MyParam As ADODB.Parameter

    MyCmd.Execute exec_sp_biginsert

  • Forgot that one :

    Set MyParam = SERVER.CREATEOBJECT ("ADODB.Parameter")

  • This is a code generating software I built a while back. It's tested and works perfectly, not to mention lightning fast, but the formatting is obviously multi line. We already felt that it was better to have working code since he as a newbie.

  • Is this thread STILL alive???

    Can you continue in a new one .... sheeshh 


    * Noel

  • Newbies take longer to understand... espicially with such a large code with asp 6.

  • This is probably the longest thread ever !!!


    * Noel

  • Close... it's the 5th thread I see hit 100. Maybe we should ask steve for a run down of the longest threads .

  • If you want a long one I have this themes for you:

    - DBA vs Developers

    - Oracle vs SQL Server

    - Indentity vs Natural Keys

    ...

     

    but I would have never imagine that "multiple inserts" would do it


    * Noel

  • I haven't seen any of those hit 100, but I agree that this is a odd one.

Viewing 15 posts - 106 through 120 (of 167 total)

You must be logged in to reply to this topic. Login to reply