dardartektips
MIS
This is probably really basic. I'm trying to make the move from programming with Microsoft Access 2000 to Visual basic 6.0 and I'm having trouble with trying to update a recordset.
I have imported data into a table named imprtGasPrices from which I would like to update a table named tblfl_dtprc.
This is my SQL statement:
when i execute this my cursortype reverts back to forward only and editmode is adeditnone and I can't add records to the recordset. I would expect the recordset to return no records since I am updating it with the current rack price of gas.
I am a complete newby at this. This cmd.commandtext is nested inside of another cmd.commandtext which is nested inside of another. Should I be using cmd, cmd1, cmd2 or is this code acceptable. Each one has a different recordset name. I use the first one to loop through the second one to update the third one.
Does anybody understand what I'm asking ? Basically what I want to know is why can't I add new records ?
Thanks,
Laura
I have imported data into a table named imprtGasPrices from which I would like to update a table named tblfl_dtprc.
This is my SQL statement:
Code:
CMD.CommandText = "SELECT * from tblfl_dtprc WHERE dt_fdp = #" & CDate(.Fields("date").Value) & "# AND prdcd_fdp = '" &
.Fields("prdcd").Value & "' AND trmnlcd_fdp = '" & .Fields("terminalcd").Value & "' AND tm_fdp = #" & .Fields("time").Value & "#"
CMD.CommandType = adCmdText
imprtGasRS.cursortype = adstatic
Set imprtGasRS = CMD.Execute
when i execute this my cursortype reverts back to forward only and editmode is adeditnone and I can't add records to the recordset. I would expect the recordset to return no records since I am updating it with the current rack price of gas.
I am a complete newby at this. This cmd.commandtext is nested inside of another cmd.commandtext which is nested inside of another. Should I be using cmd, cmd1, cmd2 or is this code acceptable. Each one has a different recordset name. I use the first one to loop through the second one to update the third one.
Does anybody understand what I'm asking ? Basically what I want to know is why can't I add new records ?
Thanks,
Laura