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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Defining Parameters in VB Script

Status
Not open for further replies.

Iashia06

Programmer
Jan 13, 2006
19
0
0
US
I'm using the following script to insert records into a table in my MS Access db. I am using Data Access Pages for the front end. However, I keep getting the error: "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."

Does anyone know how to fix this problem? I need help.


<SCRIPT language=vbscript event=onclick for=TrackingNavSave>
<!--
Dim dbLocation, strSQL, objConn, cat1
Dim prmTrackID, prmTrackSeq, prmProjID, prmProjSeq, prmProjName, prmDept

Set objConn = CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\intraweb\ProjectTracking$\ProjectTracking.mdb"


strSQL = "INSERT INTO Tracking (Tracking_ID, Tracking_Seq, Project_ID, " & _
"Project_Seq, Project_Name, Department, Dept_Head, Dept_Head_Phone, " & _
"Project_Manager, Manager_Phone, Priority, Status, Percent_Complete, " & _
"Issues, Next_Steps, Report_Week, Achievement_Level, User_Name, " & _
"Warranty_Period, Project_Description, Milestone_1, Milestone_2, " & _
"Milestone_3, Milestone_4, Milestone_5, Milestone_Status_1, " & _
"Milestone_Status_2, Milestone_Status_3, Milestone_Status_4, " & _
"Milestone_Status_5, Milestone_Due_Date_1, Milestone_Due_Date_2, " & _
"Milestone_Due_Date_3, Milestone_Due_Date_4, Milestone_Due_Date_5) " & _
"VALUES (Tracking_ID.value, Tracking_Seq.value, Project_ID.value, " & _
"Project_Seq.value, Project_Name.value, Department.value, Dept_Head.value, " & _
"Dept_Head_Phone.value, Project_Manager.value, Manager_Phone.value, " & _
"Priority.value, Status.value, Percent_Complete.value, Issues.value, " & _
"Next_Steps.value, Report_Week.value, Achievement_Level.value, " & _
"User_Name.value, Warranty_Period.value, Project_Description.value, " & _
"Milestone_1.value, Milestone_2.value, Milestone_3.value, Milestone_4.value, " & _
"Milestone_5.value, Milestone_Status_1.value, Milestone_Status_2.value, " & _
"Milestone_Status_3.value, Milestone_Status_4.value, Milestone_Status_5.value, " & _
"Milestone_Due_Date_1.value, Milestone_Due_Date_2.value, " & _
"Milestone_Due_Date_3.value, Milestone_Due_Date_4.value, Milestone_Due_Date_5.value)"
Set objConn = CreateObject ("ADODB.Command")
objConn.CommandText = strSQL
Set cat1 = CreateObject("ADOX.Catalog")
cat1.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\intraweb\ProjectTracking$\ProjectTracking.mdb"
Set prmTrackID = objConn.CreateParameter(Tracking_ID, adSmallInt, adParamInputOutput, 4)
Set prmTrackSeq = objConn.CreateParameter(Tracking_Seq, adSmallInt, adParamInputOutput, 4)
Set prmProjID = objConn.CreateParameter(Project_ID, adSmallInt, adParamInputOutput, 4)
Set prmProjSeq = objConn.CreateParameter(Project_Seq, adSmallInt, adParamInputOutput, 4)
Set prmProjName = objConn.CreateParameter(Project_Name, adVarChar, adParamInputOutput, 50)
Set prmDept = objConn.CreateParameter(Department, adVarChar, adParamInputOutput, 50)
objConn.Parameters.Append prmTrackID
objConn.Parameters.Append prmTrackSeq
objConn.Parameters.Append prmProjID
objConn.Parameters.Append prmProjSeq
objConn.Parameters.Append prmProjName
objConn.Parameters.Append prmDept
Tracking_Seq.value = Tracking_Seq.value + 1
objConn.Execute (strSQL)

Set objConn = Nothing

-->
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top