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

vba com and access DB

Status
Not open for further replies.

StefanoT

Programmer
Jul 4, 2006
1
IT
i don't know if it is the right forum to post (if it isn't please tell me the one i have to use for the question)

I'm programming an editor in vba. this editor manages a simple access db. with this editor you can enter in a table and add, modify or delete a row.

The modify procedure and the delete procedure work well.
the problem is the add procedure.
the procedure is this:

Dim pFact As IWorkspaceFactory
Dim pFW As IFeatureWorkspace
Set pFact = New AccessWorkspaceFactory
Set pFW = pFact.OpenFromFile("C:\tesi\stefano.mdb", 0)

Dim pT As ITable
Dim pC As ICursor
Dim pR As IRow


Set pT = pFW.OpenTable("Functions")

Set pR = pT.CreateRow ' <- DEBUG STOPS HERE

pR.Value(pT.FindField("nome_funzione")) = Me.NomeFunz
pR.Value(pT.FindField("tipo_funzione")) = Me.FunzSel
pR.Value(pT.FindField("layer")) = Me.LayerSel
pR.Value(pT.FindField("layer_supporto")) = Me.LayerSupSel
pR.Value(pT.FindField("attributo_supporto")) = Me.AttrSel
pR.Value(pT.FindField("condizione_attributi")) = Me.CondAttr
pR.Value(pT.FindField("operazione_geo")) = Me.operazioneGeo
pR.Value(pT.FindField("valore_geo")) = Me.valoreGeo
pR.Value(pT.FindField("supporto_geo")) = Me.supportoGeo
pR.Store


the error I get is :

"runtime error
-2147467359(80004005)
elemento non trovato in questo insieme" (that in english sounds something like element not found in this set)

in the internet i found this:

-2147467359(80004005)
Cannot add to or update database records
solution
Rename field(s), or delete and recreate field.
Set all field types to "text." Use short field names, with no
underscores, eg "curMonth." Be sure not to use SQL reserved words.


ok i tested it and doesn't work.
i have:

-deleted and recreated the DB but no changes.
-i have renamed the attributes but nothing has changed
-i had tested the path of the MDB but it is correct (i used it in modify and delete rows and it worked
-i have write and deleted the procedure 3 times to verify if a sintax error was present but no changes happened.


so, can someone tell me what is wrong in this?


Thanks for attention and sorry for my poor english.
Stefano
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top