Code: Select all
ComObjError(0)
; Create new mdb file
FileName := "test.mdb"
FileDelete, % FileName
db := ComObjCreate("ADOX.Catalog")
db.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" FileName)
; Open mdb file, and CREATE TABLE...
conn := ComObjCreate("ADODB.Connection")
conn.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" FileName)
conn.Execute("CREATE TABLE Table1(Col1 Text)")
; Insert a 300 length data
Loop, 300
testData .= "a"
conn.Execute("INSERT INTO Table1 VALUES('" . testData . "')")
; Check the data's length that just inserted
rs := conn.Execute("SELECT * FROM Table1")
MsgBox, % StrLen(rs.Fields("Col1").Value) ; <-- Only 255 characters, not 300
rs.Close(), rs := ""
conn.Close(), conn := ""
Return