Well, we sorted this out over the phone but I'm replying to the thread just for future reference. I see several errors in this code, for example:
carti = '19999'
cchasi = "HDHDGSS"
ctipo = "CARRO"
cmarca = "TOYOTA"
cmodelo= "CAMRY"
ccolor = "NEGRO"
nano = "2005"
cplaca = "ABDG32"
cmotor = '763HSD'
xselect=[insert into vehiculos(articulo,chassis,tipo,marca,modelo,color,ano,placa,motor) values(&carti,&cchasi,&ctipo,&cmarca,&cmodelo,&ccolor,&nano,&cplaca)]
Should be
carti = '19999'
cchasi = "'HDHDGSS'"
ctipo = "'CARRO'"
cmarca = "'TOYOTA'"
cmodelo= "'CAMRY'"
ccolor = "'NEGRO'"
nano = "2005"
cplaca = "'ABDG32'"
cmotor = "'763HSD'"
TEXT TO xSelect
INSERT INTO vehiculos(articulo,chassis,tipo,marca,modelo,color,ano,placa,motor) VALUES (<<carti>>,<<cchasi>>,<<ctipo>>,<<cmarca>>,<<cmodelo>>,<<ccolor>>,<<nano>>,<<cplaca>>)
ENDTEXT
oConn.Execute(xSelect)
The main point here is the command sent to the DB is not returning a recordset because it's not a SQL SELECT statement or a SP, hence having the result into a recordset object triggers an error message.
Enmanuel
>how I can make to insert a registry in a table of Access with vfp 6, I did it with ado object, but insert does not work with more of a field, it gives error me.
>
>pconn=createobject("ADODB.Connection")
>pconn.open(strconn)
>carti = '19999'
>cchasi = "HDHDGSS"
>ctipo = "CARRO"
>cmarca = "TOYOTA"
>cmodelo= "CAMRY"
>ccolor = "NEGRO"
>nano = "2005"
>cplaca = "ABDG32"
>cmotor = '763HSD'
>xselect=[insert into vehiculos(articulo,chassis,tipo,marca,modelo,color,ano,placa,motor) values(&carti,&cchasi,&ctipo,&cmarca,&cmodelo,&ccolor,&nano,&cplaca)]
>rstabla = createobject("ADODB.Recordset")
>oconn =pconn
>rstabla.cursorlocation = 3
>rstabla.cursortype = 2
>rstabla.locktype = 4
>rstabla.open (xselect,oconn)
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain