About VC 6.0 to character limit insert into data in the database
Time:10-03
I use ODBC to insert into data in SQL server 2000, but the results can only insert into 256 characters, the following code CDatabase m_dbAgent; Cstrings STR, SQL; M_dbAgent. OpenEx (DSN="yidong; UID=sa; The PWD=ilo2016 "); SQL="insert into dbo. Test (Col001) values ('"; SQL +="1 aaaaaaaaaaaaaaaaaaccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc \ CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDCCCCDDCCCCDDCCCCDDCCCCDDCCCCDDCCCCCCCCCCCD \ Ddcccccccccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2 "; SQL +="')"; M_dbAgent. The ExecuteSQL (SQL);//1, 2 end
Results only 256 characters written into the database, database table corresponding field is varchar, 8000 characters, the method of using ODBC and ADO, are so, somehow, which devoted warrior please help, thanks a lot, But the same insert statement in the query analyzer test is no problem,
CodePudding user response:
If vc write varchar columns, only 256 characters, online, etc
CodePudding user response:
AfxMessageBox (SQL);//check the SQL statement is correct M_dbAgent. The ExecuteSQL (SQL);