August 12, 2005 at 8:55 am
Remi, you work for a school? Which one?
Anyway, I read on some website that using adovbs.inc is outdated. Instead they reccomended using a Type Library. Would this Type Library work the same way as adovbs.inc?
Thanks!
M
August 12, 2005 at 9:02 am
No I meant your company, assumed you worked in part for a school. Anyways I don't know about the adovbs.inc hint. But as long as it works just use what you need.
August 12, 2005 at 9:20 am
Remi, why do I need to write out the following for every variable? I'm not sure why I need this gigantic function.
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRhospitalCanvass"
MyParam.Value = SRhospitalCanvass
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
Thanks,
M
PS: I work for Ohio State University claims department.
August 12, 2005 at 9:28 am
Set MyParam = New ADODB.Parameter
starts with a fresh parameter object
MyParam.Name = "@SRhospitalCanvass"
sets the name, mandatory
MyParam.Value = SRhospitalCanvass
sets the value, mandatory
MyParam.Size = 10
sets the size of the column, mandatory for all the text type columns and some numberss types
MyParam.Direction = adParamInput
direction of the parameter (defaults to input but I like to see it explicitly written)
MyParam.Type = adChar
datatype of the parameter, mandatory
If you don't like this format (which would be fine), you can always retype the whole thing yourself using other versions of the createparameter, but that would take you a few days.
August 12, 2005 at 9:35 am
Remi, could you please explain to me why I need this function? What does it actually do?
I thought after I created the stored procedure, I could just call the stored procedure from my asp script?
Thanks,
M
August 12, 2005 at 9:47 am
you could play around with this shortcut syntax:
with MyCmd
.ActiveConnection = my connection
.CommandTimeout = 0
.CommandText = "sp_biginsert"
.CommandType = 4
.Parameters.append.CreateParameter("@SRhospitalCanvass", adChar, adParamInput, 10, SRhospitalCavass)
............................
end with
**ASCII stupid question, get a stupid ANSI !!!**
August 12, 2005 at 9:58 am
the sp resides on sql server
asp code resides on another machine (at least another process)
asp uses this code to call the code on the server and execute it.
August 12, 2005 at 10:14 am
So I just include this function in the asp page, then call it like this?
Big insert Page
---------------
....populate form(from hidden fields) to user so he/she can make any needed changes.....
....user hits submit button....
....then call the big function...
<%
exec_sp_biginsert( 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)
%>
August 12, 2005 at 10:24 am
Well like I said I would drop the function part of it and just put the code function in the page since there shouldn't be much else on that page anyways. That way you drop some of the visual noise and it makes clearer code.
August 12, 2005 at 10:29 am
Thanks!
If I put the code in the ASP page, do I still need to write out all this?
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 = New ADODB.Parameter
MyParam.Direction = adParamReturnValue
MyParam.Name = "@Return"
MyParam.Type = adInteger
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrequestDate"
MyParam.Value = SRrequestDate
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolNameFirst"
MyParam.Value = SRschoolNameFirst
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolNameLast"
MyParam.Value = SRschoolNameLast
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolCompany"
MyParam.Value = SRschoolCompany
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolBranch"
MyParam.Value = SRschoolBranch
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolAddress1"
MyParam.Value = SRschoolAddress1
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolAddress2"
MyParam.Value = SRschoolAddress2
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolCity"
MyParam.Value = SRschoolCity
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolState"
MyParam.Value = SRschoolState
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolZip"
MyParam.Value = SRschoolZip
MyParam.Size = 20
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolPhone"
MyParam.Value = SRschoolPhone
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolFax"
MyParam.Value = SRschoolFax
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolEmail"
MyParam.Value = SRschoolEmail
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolRegion"
MyParam.Value = SRschoolRegion
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolSupervisor"
MyParam.Value = SRschoolSupervisor
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolclaimType"
MyParam.Value = SRschoolclaimType
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolDateOfLoss"
MyParam.Value = SRschoolDateOfLoss
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolInsured"
MyParam.Value = SRschoolInsured
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolClaimNumber"
MyParam.Value = SRschoolClaimNumber
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolPackaging"
MyParam.Value = SRschoolPackaging
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRschoolContactPrefs"
MyParam.Value = SRschoolContactPrefs
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantNameFirst"
MyParam.Value = SRclaimantNameFirst
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantNameMiddle"
MyParam.Value = SRclaimantNameMiddle
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantNameLast"
MyParam.Value = SRclaimantNameLast
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantOffice"
MyParam.Value = SRclaimantOffice
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantAddress1"
MyParam.Value = SRclaimantAddress1
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantAddress2"
MyParam.Value = SRclaimantAddress2
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantCity"
MyParam.Value = SRclaimantCity
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantState"
MyParam.Value = SRclaimantState
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantZip"
MyParam.Value = SRclaimantZip
MyParam.Size = 20
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantPhone"
MyParam.Value = SRclaimantPhone
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantDateOfBirth"
MyParam.Value = SRclaimantDateOfBirth
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantSSN"
MyParam.Value = SRclaimantSSN
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantSex"
MyParam.Value = SRclaimantSex
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantMaritalStatus"
MyParam.Value = SRclaimantMaritalStatus
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantSpouse"
MyParam.Value = SRclaimantSpouse
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantChildrenNum"
MyParam.Value = SRclaimantChildrenNum
MyParam.Size = 15
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantChildrenAges"
MyParam.Value = SRclaimantChildrenAges
MyParam.Size = 25
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantRace"
MyParam.Value = SRclaimantRace
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantHeightLow"
MyParam.Value = SRclaimantHeightLow
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantHeightHigh"
MyParam.Value = SRclaimantHeightHigh
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantWeightLow"
MyParam.Value = SRclaimantWeightLow
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantWeightHigh"
MyParam.Value = SRclaimantWeightHigh
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantSpecialChar"
MyParam.Value = SRclaimantSpecialChar
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantOccupation"
MyParam.Value = SRclaimantOccupation
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantInjury"
MyParam.Value = SRclaimantInjury
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantRestrictions"
MyParam.Value = SRclaimantRestrictions
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantRepresented"
MyParam.Value = SRclaimantRepresented
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantVehicle1Make"
MyParam.Value = SRclaimantVehicle1Make
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantVehicle1Model"
MyParam.Value = SRclaimantVehicle1Model
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantVehicle1Tag"
MyParam.Value = SRclaimantVehicle1Tag
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantVehicle2Make"
MyParam.Value = SRclaimantVehicle2Make
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantVehicle2Model"
MyParam.Value = SRclaimantVehicle2Model
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRclaimantVehicle2Tag"
MyParam.Value = SRclaimantVehicle2Tag
MyParam.Size = 75
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRsubjectEmployer"
MyParam.Value = SRsubjectEmployer
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerNameFirst"
MyParam.Value = SREmployerNameFirst
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerNameLast"
MyParam.Value = SREmployerNameLast
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerAddress1"
MyParam.Value = SREmployerAddress1
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerAddress2"
MyParam.Value = SREmployerAddress2
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerCity"
MyParam.Value = SREmployerCity
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerState"
MyParam.Value = SREmployerState
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerZip"
MyParam.Value = SREmployerZip
MyParam.Size = 20
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerPhone"
MyParam.Value = SREmployerPhone
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerContact"
MyParam.Value = SREmployerContact
MyParam.Size = 3
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SREmployerInfo"
MyParam.Value = SREmployerInfo
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeNameFirst"
MyParam.Value = SRcollegeNameFirst
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeNameLast"
MyParam.Value = SRcollegeNameLast
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeAddress1"
MyParam.Value = SRcollegeAddress1
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeAddress2"
MyParam.Value = SRcollegeAddress2
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeCity"
MyParam.Value = SRcollegeCity
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeState"
MyParam.Value = SRcollegeState
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeZip"
MyParam.Value = SRcollegeZip
MyParam.Size = 20
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegePhone"
MyParam.Value = SRcollegePhone
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeCopyOnReports"
MyParam.Value = SRcollegeCopyOnReports
MyParam.Size = 3
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeContact"
MyParam.Value = SRcollegeContact
MyParam.Size = 3
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRcollegeInfo"
MyParam.Value = SRcollegeInfo
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabCompany"
MyParam.Value = SRrehabCompany
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabNameFirst"
MyParam.Value = SRrehabNameFirst
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabNameLast"
MyParam.Value = SRrehabNameLast
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabAddress1"
MyParam.Value = SRrehabAddress1
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabAddress2"
MyParam.Value = SRrehabAddress2
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabCity"
MyParam.Value = SRrehabCity
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabState"
MyParam.Value = SRrehabState
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabZip"
MyParam.Value = SRrehabZip
MyParam.Size = 20
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabPhone"
MyParam.Value = SRrehabPhone
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabContact"
MyParam.Value = SRrehabContact
MyParam.Size = 3
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRrehabInfo"
MyParam.Value = SRrehabInfo
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingNameFirst"
MyParam.Value = SRbuildingNameFirst
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingNameLast"
MyParam.Value = SRbuildingNameLast
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingAddress1"
MyParam.Value = SRbuildingAddress1
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingAddress2"
MyParam.Value = SRbuildingAddress2
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingCity"
MyParam.Value = SRbuildingCity
MyParam.Size = 150
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingState"
MyParam.Value = SRbuildingState
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingZip"
MyParam.Value = SRbuildingZip
MyParam.Size = 20
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingPhone"
MyParam.Value = SRbuildingPhone
MyParam.Size = 35
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingContact"
MyParam.Value = SRbuildingContact
MyParam.Size = 3
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbuildingInfo"
MyParam.Value = SRbuildingInfo
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRreason"
MyParam.Value = SRreason
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRobjective1"
MyParam.Value = SRobjective1
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRobjective2"
MyParam.Value = SRobjective2
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRobjective3"
MyParam.Value = SRobjective3
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbudgetAmount"
MyParam.Value = SRbudgetAmount
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRsingleDaySurv"
MyParam.Value = SRsingleDaySurv
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRsceneInvestigation"
MyParam.Value = SRsceneInvestigation
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRactivityCheck"
MyParam.Value = SRactivityCheck
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRresidencyCheck"
MyParam.Value = SRresidencyCheck
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRmultidaySurv"
MyParam.Value = SRmultidaySurv
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRstatement"
MyParam.Value = SRstatement
MyParam.Size = 500
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRbackgroundCheck"
MyParam.Value = SRbackgroundCheck
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRwidowCheck"
MyParam.Value = SRwidowCheck
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRhospitalCanvass"
MyParam.Value = SRhospitalCanvass
MyParam.Size = 10
MyParam.Direction = adParamInput
MyParam.Type = adChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
MyParam.Name = "@SRdueDate"
MyParam.Value = SRdueDate
MyParam.Size = 50
MyParam.Direction = adParamInput
MyParam.Type = adVarChar
MyCmd.Parameters.Append MyParam
Set MyParam = New ADODB.Parameter
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
End Function
August 12, 2005 at 11:45 am
That's the code for the asp side of it!!!!!!!!!!
Did you actually test it?
You can't use As Datatype in asp and you didn't correc this yet : Set MyParam = New ADODB.Parameter (just use search and replace).
Did you test the sp at least???
August 12, 2005 at 11:54 am
Remi, I tested the SP and it worked beautifully. You are a genius...I really do hope you make big $$$.
I'm still trying to figure out the ASP part. I just recently started using ASP so the learning curve seems pretty steep right now.
Thanks!
M
August 12, 2005 at 12:00 pm
OK
final thaughts :
MyCn.Open 'just needs an opened connection before the next line
MyCmd.ActiveConnection = MyCn 'set the connection
MyCmd.Execute exec_sp_biginsert
MyCn.Close 'assuming you're done with it
ReturnValue = CInt(MyCmd.Parameters("@Return").Value) 'you'll need to declare this variavle
'cleanup
Set MyParam = Nothing
Set MyCmd = Nothing
End Function
August 12, 2005 at 12:01 pm
magyar - did you have time to take a look at the shortcut syntax i sent you ?! that should cut down considerably on your typing...
never mind...i just saw that remi has the exec sql...
**ASCII stupid question, get a stupid ANSI !!!**
August 12, 2005 at 12:05 pm
Remi...why did you cross out those two lines? Just curious...
Thanks,
M
Viewing 15 posts - 76 through 90 (of 167 total)
You must be logged in to reply to this topic. Login to reply