G
Guest
Folks, I have vba code that processes a translation and transfer of fields
and data from one table to another. The table I am coming from has cryptic
field names and some data that needs to be evaluated and changed before
delivery/matching to the new table which has more descriptive field names and
the cleaned data. The process is something like this :
Loop for each of the records in the source table
Match source(fieldname) to translation table to retrieve desired
newfield name
'****Below is the problem.
Set rstTargetTbl1 = CurrentDb.OpenRecordset("GainLossDlab")
' rstTargetTbl1.Index = "PrimaryKey"
'If not present add a new row for this Item
rstTargetTbl1.AddNew
If IsNull(rstSource(rsFieldName.Name)) Then
rstTargetTbl1(rstKeyTbl("NewFieldName")) = rstSource
(rsFieldName.Name)
Else
rstTargetTbl1(rstKeyTbl("NewFieldName")) = strTemp &
rstSource(rsFieldName.Name)
End If
rstTargetTbl1("BBN") = rstSource("ASC")
rstTargetTbl1("SAS_DATA_SEPARATOR") = rstSource("FILE")
rstTargetTbl1.Update
Set rstTargetTbl1 = Nothing
'**** End of problem area
LOOP through all addtional fields in source table insert into target
tbl record
The problem is that when it goes through this process every time it adds a
new record the size of the database increases by about 920kb. I am trying to
processes about 267000 records(record is 138 fields for a total record size
of 552bytes). The source table is linked in but the size of the db with the
data is only 150MB or so. The code db with a partial complete of this process
is about 100M but it expands to the 2G limit after processing say 10k
records. I have done the process manually and with both the source and target
data tables as local the db is only 525MB.
Any thoughts on what is causing this and how to recode around it? I know of
some options but I done this operation in Access 97 and Access 2000( I am
using Access 2002/3 format and DAO).
Thanks,
CJ
and data from one table to another. The table I am coming from has cryptic
field names and some data that needs to be evaluated and changed before
delivery/matching to the new table which has more descriptive field names and
the cleaned data. The process is something like this :
Loop for each of the records in the source table
Match source(fieldname) to translation table to retrieve desired
newfield name
'****Below is the problem.
Set rstTargetTbl1 = CurrentDb.OpenRecordset("GainLossDlab")
' rstTargetTbl1.Index = "PrimaryKey"
'If not present add a new row for this Item
rstTargetTbl1.AddNew
If IsNull(rstSource(rsFieldName.Name)) Then
rstTargetTbl1(rstKeyTbl("NewFieldName")) = rstSource
(rsFieldName.Name)
Else
rstTargetTbl1(rstKeyTbl("NewFieldName")) = strTemp &
rstSource(rsFieldName.Name)
End If
rstTargetTbl1("BBN") = rstSource("ASC")
rstTargetTbl1("SAS_DATA_SEPARATOR") = rstSource("FILE")
rstTargetTbl1.Update
Set rstTargetTbl1 = Nothing
'**** End of problem area
LOOP through all addtional fields in source table insert into target
tbl record
The problem is that when it goes through this process every time it adds a
new record the size of the database increases by about 920kb. I am trying to
processes about 267000 records(record is 138 fields for a total record size
of 552bytes). The source table is linked in but the size of the db with the
data is only 150MB or so. The code db with a partial complete of this process
is about 100M but it expands to the 2G limit after processing say 10k
records. I have done the process manually and with both the source and target
data tables as local the db is only 525MB.
Any thoughts on what is causing this and how to recode around it? I know of
some options but I done this operation in Access 97 and Access 2000( I am
using Access 2002/3 format and DAO).
Thanks,
CJ