Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Ole Exception ParentCatalog ADOX 1261
The wwwbatch.ini file contains the following error information.
[OLE Exception] ADOX.Table=Object is no longer valid.Here is my script:
---------------------------------------- file = "C:\TEMP\NEW.MDB" ; change to suit your situation If FileExist(file) == @TRUE FileDelete(file) Endif Conn="Provider=MicroSoft.Jet.OLEDB.4.0; Data Source=%file%;Jet OLEDB:Engine Type=4" BoxOpen("Creating New ACCESS Database...",Conn) cat = ObjectOpen("ADOX.Catalog") cat.Create(Conn) tbl = ObjectOpen("ADOX.Table") tbl.Name = "MyTable" ; this next line will fail tblA = tbl.ParentCatalog ; <----- OLE Exception ;[OLE Exception] ;ADOX.Table=Object is no longer valid. tblA = cat ObjectClose(tbl) ObjectClose(cat) BoxShut() exit ----------------------------------------
I re-wrote the code to create a catalog and table as follows, which seems to work. I found the Delay to be necessary, but the time could be tweaked.
---------------------------------------- ;----------------------- file = "C:\TEMP\NEW.MDB" ;----------------------- If FileExist(file) Then FileDelete(file) cat = ObjectOpen("ADOX.Catalog") cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%file%;Jet OLEDB:Engine Type=4") tbl = ObjectOpen("ADOX.Table") tbl.Name = "MyTable" tbl.ParentCatalog = cat ;<----------Added x = tbl.ParentCatalog tbls = cat.Tables tbls.Append(tbl) Delay(1) ObjectClose(tbls) ObjectClose(tbl) ObjectClose(cat) ----------------------------------------
Article ID: W15600
File Created: 2003:05:13:11:29:10
Last Updated: 2003:05:13:11:29:10