Multiple inserts

  • Remi...why did you cross out those two lines?   Just curious...

     

    Thanks,

    M

     

     

  •  

    Ok, all those lines now look like this:

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

    MyParam.Name = "@SRschoolNameFirst"

    MyParam.Value = SRschoolNameFirst

    MyParam.Size = 150

    MyParam.Direction = adParamInput

    MyParam.Type = adVarChar

  • You' need to rewrite the whole freaking thing... making sure you don't make any mistakes, this would take you days, hours if you're good. Mine is 100% tested, so as long as you didn't change the sp, it'll work without any trouble.

    Also, I striked a few things because there are not needed outside of the function's frame.

  • yup, simple search and replace which can't really fail in this case.

  • Remi,

    wait now I'm confused.   What would take me days to rewrite??

    Thanks,

    M

     

  • The whole asp call code with this version.

    .Parameters.append.CreateParameter("@SRhospitalCanvass", adChar, adParamInput, 10, SRhospitalCavass)

    Writting it isn't very long, but testing it is.

  • Remi,

    How come I just can't do this once? 

    <%

    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

    %>

  • you can...then you have to pass all the parameters to your procedure!







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

  • If I can write this out just once, then why did Remi write it out for each and every variable?  There must be a method to his madess

     

    -M

     

  • You have 120+ parameters to pass... you can't just call the sp and not tell it what to insert in the tables.

  •  

    Can't I just pass it like you would a function?

     

    Like

     MyCmd.CreateParameter(SRrequestDate,  SRschoolNameFirst,  SRschoolNameLast,  SRschoolCompany,  SRschoolBranch,  SRschoolAddress1,  SRschoolAddress2,  SRschoolCity,  SRschoolState,  SRschoolZip,  SRschoolPhone,  SRschoolFax,  SRschoolEmail,  SRschoolRegion,  SRschoolSupervisor,  SRschoolclaimType,  SRschoolDateOfLoss,  SRschoolInsured,  SRschoolClaimNumber,  SRschoolPackaging,  SRschoolContactPrefs,  SRclaimantNameFirst,  SRclaimantNameMiddle,  SRclaimantNameLast,  SRclaimantOffice,  SRclaimantAddress1,  SRclaimantAddress2,  SRclaimantCity,  SRclaimantState,  SRclaimantZip,  SRclaimantPhone,  SRclaimantDateOfBirth,  SRclaimantSSN,  SRclaimantSex,  SRclaimantMaritalStatus,  SRclaimantSpouse,  SRclaimantChildrenNum,  SRclaimantChildrenAges,  SRclaimantRace,  SRclaimantHeightLow,  SRclaimantHeightHigh,  SRclaimantWeightLow,  SRclaimantWeightHigh,  SRclaimantSpecialChar,  SRclaimantOccupation,  SRclaimantInjury,  SRclaimantRestrictions,  SRclaimantRepresented,  SRclaimantVehicle1Make,  SRclaimantVehicle1Model,  SRclaimantVehicle1Tag,  SRclaimantVehicle2Make,  SRclaimantVehicle2Model,  SRclaimantVehicle2Tag,  SRsubjectEmployer,  SREmployerNameFirst,  SREmployerNameLast,  SREmployerAddress1,  SREmployerAddress2,  SREmployerCity,  SREmployerState,  SREmployerZip,  SREmployerPhone,  SREmployerContact,  SREmployerInfo,  SRcollegeNameFirst,  SRcollegeNameLast,  SRcollegeAddress1,  SRcollegeAddress2,  SRcollegeCity,  SRcollegeState,  SRcollegeZip,  SRcollegePhone,  SRcollegeCopyOnReports,  SRcollegeContact,  SRcollegeInfo,  SRrehabCompany,  SRrehabNameFirst,  SRrehabNameLast,  SRrehabAddress1,  SRrehabAddress2,  SRrehabCity,  SRrehabState,  SRrehabZip,  SRrehabPhone,  SRrehabContact,  SRrehabInfo,  SRbuildingNameFirst,  SRbuildingNameLast,  SRbuildingAddress1,  SRbuildingAddress2,  SRbuildingCity,  SRbuildingState,  SRbuildingZip,  SRbuildingPhone,  SRbuildingContact,  SRbuildingInfo,  SRreason,  SRobjective1,  SRobjective2,  SRobjective3,  SRbudgetAmount,  SRsingleDaySurv,  SRsceneInvestigation,  SRactivityCheck,  SRresidencyCheck,  SRmultidaySurv,  SRstatement,  SRbackgroundCheck,  SRwidowCheck,  SRhospitalCanvass,  SRdueDate,  SRcomments)

  • No.

    The command parameters are strong typed.

    What are you complaining about, I probabely saved a full week of work here. Why aren't finishing the 2 minutes of work left and getting on with the rest of teh project??

  • magyar - you have to explicitly spell out the name, type, direction, size and value of the parameter....when i sent you my shortcut syntax i was telling you to do all of this in one line as opposed to remi's...

    but then since remi already has this all worked and ironed out you'll probably be better off going with the tried and tested...

    if you have more time to spend on this i think by all means you should...otherwise if speed is any consideration take remi's code and wow them...







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

  • Remi,

    No complaining, just trying to understand.  I've been looking on MSDN, and other sites, but I can't find a explanation on how to pass a bunch of parameters like what I'm trying to do.  I know you wrote everything out, but I don't like to just copy and paste, I want to understand the theory behind it.  So next time I need to do this, I'll know how to do it and why certain things are done a certain way.

    M

     

  • Just create a test sp and try to recreate the code I build, that'll give you a better understanding of the task at hand... but beleive me, my wizard saved me weeks of work and I can trust it.

Viewing 15 posts - 91 through 105 (of 167 total)

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