cDestDir = "c:\" cDestDBC = "mydbc.dbc" Set oCat = CreateObject("ADOX.Catalog.2.7") oCat.Create "Provider=VFPOLEDB.1;Data Source=" & cDestDir & cDestDBC Set oConn = CreateObject("ADODB.Connection.2.7") With oConn .ConnectionString = _ "Provider=VFPOLEDB.1;Data Source=" & cDestDir & cDestDBC .CursorLocation = 2 ' adUseServer .Mode = 16 ' adModeShareDenyNone .Open End With ' When creating a table, always do it with a column ' called "CreateDate", it doesn't get in ' the way of any other code you are going to ' do and you will always know when a row was ' first created with it. Then add the actual ' columns you need with ALTER TABLE statements. oConn.Execute("Create Table " & cDestDir & "ShowF2 ( tCreateDt t(8) Null Default DateTime() )") oConn.Execute("Alter Table ShowF2 Add Column cShowID c(30) Null ") oConn.Execute("Alter Table ShowF2 Add Column mDescript m Null") oConn.Execute("Alter Table ShowF2 Add Column climitations c(239) ") oConn.Execute("Insert Into ShowF2(cShowID) Values('4')") Set oConn = NothingAnd this does the actual AppendChunk work.
cTxtShowID = 4 cTxtDescription = String(2560,"x") cDestDir = "c:\" cDestDBC = "mydbc.dbc" Set oConn = CreateObject("ADODB.Connection.2.7") With oConn .ConnectionString = "Provider=VFPOLEDB.1;Data Source=" & cDestDir & cDestDBC .CursorLocation = 2 .Mode = 16 .Open End With Set oRS = CreateObject("ADODB.RecordSet.2.7") oRs.cursortype = 1 oRs.cursorlocation = 3 oRs.locktype = 3 cSQL = "Select cShowID , mDescript , tCreateDt , cLimitations from ShowF2 Where cShowID = '" & cTxtShowID & "'" oRS.Open cSQL , oConn For iCnt = 0 To oRS.Fields.Count - 1 Response.Write oRS(iCnt).Name & "<br/>" & vbCRLF Response.Write oRS(iCnt) & "<br/>" & vbCRLF Response.Write "-------------------" & "<br/>" & vbCRLF Next oRS.Fields("cLimitations") = "None" oRS.Update iChunk = 254 For iNo = 1 to len(cTxtDescription) step iChunk iStartAt = iNo cWorkString = mid(cTxtDescription, iStartAt , iChunk ) Response.Write "At byte " & iNo & vbCRLF & "<br/>" oRs.Fields("mDescript").AppendChunk(cWorkString) Next Response.Write "<br/><br/> Adding a null on the end, probably not " Response.Write "needed but leave it there for future.<br/>" & vbCRLF oRS("mDescript").AppendChunk( ChrB(0) ) Response.Write "Flush recordset to disk.<br/>" oRS.Update oRS.Close Set oRS = Nothing Set oConn = NothingThanks for reading this far!