hi all, this is driving me crazy and this forum is my usual last resort when i cant get something working! im trying to add some data to a table (access db). but first i need to find the primary key id of the fields im about to enter. im dealing with dates here, hence the bits of code concerning dates. so far i have:
var addMonthFinalArray = new Array
var addMonthFinalArray2 = new Array
var z = 0
var weekInt = 0
while (z <= Number(Request("selWeeks"))){
newDayVar = Number(Number(dayVar) + Number(weekInt))
// split date to american format
addMonthFinalArray[z] = new Date (monthVar + "/" + newDayVar + "/" + yearVar)
var rsFindID = Server.CreateObject("ADODB.Recordset");
rsFindID.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("../includes/meditect.mdb");
rsFindID.Source = "SELECT * FROM tbDates WHERE dateName = #" + formatUKDate(addMonthFinalArray[z]) + "#"
rsFindID.CursorType = 1;
rsFindID.CursorLocation = 2;
rsFindID.LockType = 3;
rsFindID.Open()
// passing the recordset object and not the actual value?
addMonthFinalArray2[z] = rsFindID("dateID")
Response.write(addMonthFinalArray2[z] + "<br>")
// CANT GET ID INTO FOLLOWING TABLE?
/*////////////////////////////
rsAdd.AddNew()
rsAdd("clinicID") = Number(Request("clinicID"))
rsAdd("dateID") = addMonthFinalArray2[z]
rsAdd("timeID") = Number(Request("selTime"))
rsAdd.Update()
//////////////////////////*/
weekInt += 7
z ++
}
so i can write out addMonthFinalArray2[z], but cant get the value of it into my db. i get an EOF/BOF error. i can hardcode a value on the line:
rsAdd("dateID") = addMonthFinalArray2[z]
so it would be
rsAdd("dateID") = 9
and that works fine. im thinking: am i pasisng the rcordset object to addMonthFinalArray2 as opposed to the actual value? if i try:
addMonthFinalArray2[z] = Number(rsFindID("dateID")) i get a bof error. any help would be muchly appreciated. ive nearly got this headache of a site finished, and this is my final hurdle (apart from trying cross domain updating of databases!). many thanks
- G





Bookmarks