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

readonly error: using dao with mysql

Status
Not open for further replies.

cihatkarli

Programmer
May 22, 2007
18
TR
im tryiny to create a table and fields with dao in a mysql db. i create them but when i try to write something an error "db is readonly" occurs.

Any ideas?
 
Set ws = DBEngine.Workspaces(0)
Let strConnection = "ODBC;DSN=takip;"
Set vtab = ws.OpenDatabase("", False, False, strConnection)
'Workspaces(0).OpenDatabase(App.Path & "\vt.mdb", x1gln, x2gln)


Set tdef = vtab.CreateTableDef(Tablo)
--------------
-For i = 1 To Len(alan)


x:
8 kk = Mid(alan, i, 1)
If kk = "," Then j = j + 1: i = i + 1: GoTo x
alani(j) = alani(j) & kk
Next


For p = 1 To Len(tip)
xx:

yy = Mid(tip, p, 1)
If yy = "," Then t = t + 1: p = p + 1: GoTo xx
If yy = 1 Then tipsx(t) = dbText
'If yy = 2 Then tipsx(t) = dbFloat
If yy = 2 Then tipsx(t) = dbDate
Next

For i = 1 To j

tdef.Fields.Append tdef.CreateField(alani(i), tipsx(i), 50)

Next


vtab.TableDefs.Append tdef

-------------------------------------

this is how i create table

--------------------------

and this is my query


---------------------

Call tblb("select * from " & Tablo.Text)



tbl.AddNew

---------------------
DANG!! Error

And i'm getting a catastrophic error if i use ado to connect :'(
 
I seem to recall something about having to perform a "flush privlidges" command on the MySQL DB after modifying the structure or user permissions; this could be your problem ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top