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

Table Append Record is too large

Status
Not open for further replies.

lrfcbabe

Programmer
Jul 19, 2001
108
US
When I add more than forty four columns, NewDB.Tables.Append(NewDB) throws an error "Record is to Large"
Otherwise it to work perfectly.

Code:
  Private Sub CreateGPSMastertbl()
    Dim NewDB As New ADOX.Catalog()
    NewDB.Create(strConn + vFolder + "GPS" + DateTime.Now.ToString("yyyyMMdd") + ".mdb;Jet OLEDB:Engine Type=5")

    Dim NewDT As New ADOX.Table()
    NewDT.Name = "MasterTabls"
    NewDT.Columns.Append("First", ADOX.DataTypeEnum.adDouble)
    NewDT.Columns.Append("Second", ADOX.DataTypeEnum.adDouble)
    NewDT.Columns.Append("Third", ADOX.DataTypeEnum.adWChar, 3)
    NewDT.Columns.Append("Fourth", ADOX.DataTypeEnum.adWChar, 50)
    NewDT.Columns.Append("Fifth", ADOX.DataTypeEnum.adDouble)
    NewDT.Columns.Append("Sixth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Seventh", ADOX.DataTypeEnum.adWChar, 30)
    NewDT.Columns.Append("Eighth", ADOX.DataTypeEnum.adWChar, 5)
    NewDT.Columns.Append("Nineth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Tenth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Eleventh", ADOX.DataTypeEnum.adWChar, 10)
    NewDT.Columns.Append("Twelveth", ADOX.DataTypeEnum.adWChar, 10)
    NewDT.Columns.Append("Thirteenth", ADOX.DataTypeEnum.adWChar, 10)
    NewDT.Columns.Append("Fourteenth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Fifteenth", ADOX.DataTypeEnum.adDouble)
    NewDT.Columns.Append("Sixteenth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Seventeenth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Eighteenth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Nineteenth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Twentyeth", ADOX.DataTypeEnum.adWChar, 30)
    NewDT.Columns.Append("Twentyfirst", ADOX.DataTypeEnum.adWChar, 30)
    NewDT.Columns.Append("Twentysecond", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Twentythird", ADOX.DataTypeEnum.adWChar, 30)
    NewDT.Columns.Append("Twentyfourth", ADOX.DataTypeEnum.adWChar, 100)
    NewDT.Columns.Append("Twentyfifth", ADOX.DataTypeEnum.adWChar, 100)
    NewDT.Columns.Append("Twentysixth", ADOX.DataTypeEnum.adWChar, 100)
    NewDT.Columns.Append("Twentyseventh", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Twentyeighth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Twentynineth", ADOX.DataTypeEnum.adWChar, 20)
    NewDT.Columns.Append("Thirtyeth", ADOX.DataTypeEnum.adWChar, 10)
    NewDT.Columns.Append("Thirtyfirst", ADOX.DataTypeEnum.adWChar, 100)
    NewDT.Columns.Append("Thirtysecond", ADOX.DataTypeEnum.adWChar, 100)
    NewDT.Columns.Append("Thirtythird", ADOX.DataTypeEnum.adWChar, 100)
    NewDT.Columns.Append("Thirtyfourth", ADOX.DataTypeEnum.adWChar, 255)
    NewDT.Columns.Append("Thirtyfifth", ADOX.DataTypeEnum.adWChar, 255)
    NewDT.Columns.Append("Thirtysixth", ADOX.DataTypeEnum.adWChar, 255)
    NewDT.Columns.Append("Thirtyseventh", ADOX.DataTypeEnum.adDouble)
    NewDT.Columns.Append("Thirtyeight", ADOX.DataTypeEnum.adDouble)
    NewDT.Columns.Append("Thirtynineth", ADOX.DataTypeEnum.adWChar, 36)
    NewDT.Columns.Append("Fourtyeth", ADOX.DataTypeEnum.adWChar, 36)
    NewDT.Columns.Append("Fourtyfirst", ADOX.DataTypeEnum.adDate)
    NewDT.Columns.Append("Fourtysecond", ADOX.DataTypeEnum.adDate)
    NewDT.Columns.Append("Fourtythird", ADOX.DataTypeEnum.adWChar, 36)
    NewDT.Columns.Append("Fourtyfourth", ADOX.DataTypeEnum.adWChar, 20)
    'NewDT.Columns.Append("Fourtyfifth", ADOX.DataTypeEnum.adWChar, 100)
    'NewDT.Columns.Append("Fourtysixth", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fourtyseventh", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fourtyeighth", ADOX.DataTypeEnum.adWChar, 100)
    'NewDT.Columns.Append("Fourtynineth", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fiftyeth", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fiftyfirst", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fiftysecond", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fiftythird", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fiftyfourth", ADOX.DataTypeEnum.adDouble)
    'NewDT.Columns.Append("Fiftyfifth", ADOX.DataTypeEnum.adWChar, 10)
    'NewDT.Columns.Append("Fiftysixth", ADOX.DataTypeEnum.adWChar, 20)
    'NewDT.Columns.Append("Fiftyseventh", ADOX.DataTypeEnum.adBoolean)
    'NewDT.Columns.Append("Fiftyeighth", ADOX.DataTypeEnum.adWChar, 50)

    NewDB.Tables.Append(NewDT)

    NewDB = Nothing
    NewDT = Nothing

  End Sub
 

Try using "adVarWChar" instead of "adWChar" and see if that helps.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thank You very much, that worked.
Step 2 setting properties.
 
OK, if I comment out appending the FLAG column this works fine, when I add it back I get...
COMException was unhandled
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Is FLAG a reserved word that I do not know about? Or is this something else? I am guessing the latter.

Code:
    NewDT.Columns.Append("Quad", ADOX.DataTypeEnum.adVarWChar, 20)
    NewDT.Columns("Quad").Attributes = ColumnAttributesEnum.adColNullable

    NewDT.Columns.Append("Flag", ADOX.DataTypeEnum.adBoolean)
    NewDT.Columns("Flag").Attributes = ColumnAttributesEnum.adColNullable

    NewDT.Columns.Append("Datum", ADOX.DataTypeEnum.adVarWChar, 50)
    NewDT.Columns("Datum").Attributes = ColumnAttributesEnum.adColNullable

    NewDT.Columns.Append("PERTY", ADOX.DataTypeEnum.adVarWChar, 50)
    NewDT.Columns("PERTY").Attributes = ColumnAttributesEnum.adColNullable

    NewDT.Columns.Append("QWERTY", ADOX.DataTypeEnum.adVarWChar, 50)
    NewDT.Columns("QWERTY").Attributes = ColumnAttributesEnum.adColNullable

    NewDB.Tables.Append(NewDT)
 
OOPS, my bad, cannot set type Boolean, Nullable.
 
I do not want to change the names of all the fields. Hope you do not mind me using this thread, it is all the same app.
What can I do to preserve the column name?
Thanks again
Code:
    Dim NDR As DataRow = DT1.NewRow()
    NDR(DT1.columns("Point On").ordinal) = strPointonPipeValue  <-THIS DOES NOT WORK
    NDR.item("Point On") = strPointonPipeValue                  <-THIS DOES NOT WORK
    NDR("Point On") = strPointonPipeValue                       <-THIS DOES NOT WORK
    NDR("PointOn") = strPointonPipeValue                        <-THIS DOES
    DT1.Rows.Add(NDR)
    DA1.Update(DS1, "GPSMaster")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top