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

RDO error 400002 : 300007 when using a field

Status
Not open for further replies.

sleeplessnights

IS-IT--Management
Aug 9, 2004
6
BE
HI,
I've mad a database in MS sql 2000 server
and with a visual basic project i'm trying
to edit a table this works fine if I input the values
as '100' but when I want to refer to a field from
a form for instants field IDNR I get the error
Run-time error 40002
37000 :[Pervasive][ODBC Client Interface][LNA][Pervasive]
[ODBC Engine Interface]Syntax Error : Insert Into
H0900(IserIDNR) values (IDNR<<???>>)
I looked this up on microsoft and found that I need to
use :
SQL = "Insert into H0900(UserIDNR) values (IDNR)"
cn.execute SQL SQLExecDirect
but I still get the same error

could someone point me in the wright direction
Kind Regards
Kevin
 
Is there a reason why you are using RDO and not ADO?

I assume you replace the IDNR with an actual value from somewhere in your VB app i.e.

Code:
    SQL = "Insert into H0900(UserIDNR) values (" & TextBox1.Text & ")"
      cn.execute SQL SQLExecDirect
What field type is UserIDNR?

"Own only what you can carry with you; know language, know countries, know people. Let your memory be your travel bag.
 
What client library/tools are you using?
<snip>[blue]SQL = "Insert into H0900(UserIDNR) values (IDNR)"[/blue]</snip>

If I am readint this correctly SQL Server thinks you are inserting a column called "IDNR".

Reason is that if you need to insert the string IDNR into the table, you need to enclose it in quotes..

i.e.
[blue]SQL = "Insert into H0900(UserIDNR) values ([red]'[/red]IDNR[red]'[/red])"[/blue]

If you are trying to concatinate a command with a variable try

[blue]SQL = "Insert into H0900(UserIDNR) values ([red]'[/red][black]" & [/black] IDNR [black]& "[/black][red]'[/red])"[/blue]

HTH


Rob



 
Thanks this works fine !

the reason I want to use RDO is because
I don't want to use access as the database
so I use MKD files like in demodatabase from sql
server 2000 .
This because it's faster and less instructions

At least I think so.

any way thanks for the help
 
I think you are mistaking ADO with DAO, You should probably use ADO (ActiveX Data Objects) as RDO is the old version of ADO and isnt supported anymore.

"Own only what you can carry with you; know language, know countries, know people. Let your memory be your travel bag.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top