Hello all,
I have a problem when using ADO connection. my code be like this :
IF ISCLEAR(ADOConn) THEN
CREATE(ADOConn);
ConnStr := STRSUBSTNO('%1',
'Provider=Microsoft.Jet.OLEDB.4.0;' +
'Data Source=C:\xxx\ yyy.mdb;Persist Security Info=False');
ADOConn.Open(ConnStr);
CREATE(ADORec);
// Insert
SQLStr :=
'INSERT INTO [DRAWINGS] (' +
'[ID], ' +
'[GROUP_ACCOUNT], ' +
'[ACCOUNT_NO], ' +
'[CARD_NO], ' +
'[CUSTOMER_NAME]) VALUES (' +
'''' + id + ''',' +
'''' + grpacc + ''',' +
'''' + accno + ''',' +
'''' + crdno + ''',' +
'''' + custname + ''')';
ADOConn.Execute(SQLStr);
ADOConn.Close;
CLEAR(ADORec);
CLEAR(ADOConn);
When I try to Run there is error like this :
"Overflow under type coversion text to text ......"
My Navision table :
ID - text 50
Group account - text 50
Account no - text 50
card no - text 50
customer name - text 30
My Access table :
ID - Number
Group account - text 50
Account no - text 50
card no - text 50
customer name - text 30
Anyone can tell me how to solve the problem?
regards,
Angelo
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
due to string limit in Nav, try execute sql query directly in AdoConn.Execute function.
For better understanding try using Text constant with strsubstno function.
Make some constant like SQLSTR with text:
INSERT INTO [DRAWINGS] ([ID],[GROUP_ACCOUNT], [ACCOUNT_NO],[CARD_NO],[CUSTOMER_NAME]) VALUES ('%1','%2','%3','%4','%5')
And then use this const like Hope it helps.
Br,
Igor Beeone