Dear All,
I want get the data from SQL tables directtly. I have used ADO for connection. Connection is ok.
When I want get results in Record set it is giving an error ' The Length of the text string exceeds the size of the string buffer'
[code]Name DataType Subtype Length
conn Automation 'Microsoft ActiveX Data Objects 6.0 Library'.Connection
LADOCommand Automation 'Microsoft ActiveX Data Objects 6.0 Library'.Command
ADOConnection Automation 'Microsoft ActiveX Data Objects 6.0 Library'.Connection
ADORecSet Automation 'Microsoft ActiveX Data Objects 6.0 Library'.Recordset
ADOStream Automation 'Microsoft ActiveX Data Objects 6.0 Library'.Stream
SQLString Text 1024
ConnString Text 250
RecordsAffected Text 1
RSOption Integer
FieldValue Text 100
DatabaseName Text 30
NewDate Date
Lastdate Date
firstdate Date
VARSQLString Variant
mdate Text 30
kmk Variant
IF ISCLEAR(ADOConnection) THEN
BEGIN
IF NOT CREATE(ADOConnection) THEN
BEGIN
ERROR(Text002);
END;
END;
IF ISCLEAR(ADORecSet) THEN
BEGIN
IF NOT CREATE(ADORecSet) THEN
BEGIN
ERROR(Text002);
END;
END;
ADORecSet.MaxRecords(10000);
IF ISCLEAR(conn) THEN
BEGIN
IF NOT CREATE(conn) THEN
BEGIN
ERROR(Text002);
END;
END;
DatabaseName:='TestDataSql';
ConnString:='Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog='+DatabaseName+';Data Source=KRISHNA';
kname:='Binesh';
RecordsAffected:=' ';
RSOption:=0;
//singleQuote:='';
SQLString:='SELECT FGROUPCODE,FLOCATIONCODE,FWAREHOUSECODE,FWAREHOUSENAME FROM MAS001';
MESSAGE(SQLString);
ADOConnection.ConnectionString(ConnString);
ADOConnection.Open;
ADOConnection.Execute(VARSQLString);
RecordsAffected:=' ';
RSOption:=0;
ADORecSet:=ADOConnection.Execute(VARSQLString,RecordsAffected,RSOption);
ADORecSet.MoveFirst;
FieldValue:=ADORecSet.Fields.Item('pname').Value;
MESSAGE(FieldValue);[/code]
Comments
Try with increase the length of all the variables & check.
Thanks,
Kavita M. Mutha
Kavita Mutha
I am getting the values.
1. I need to check for big record
2. Put the same in loop to get all values into my Nav table.
Thank you, best catch.
But I am still in trouble to get NULL values in my NAV Table. Unable to convert to field type .
Please help
Intime date and time
Outtime Date and time
Deptname text
Totals Integer