Home > Software engineering >  Can be inserted into the database, but can't change what reason be? Thank you very much!
Can be inserted into the database, but can't change what reason be? Thank you very much!

Time:10-01

VB6 + SQL2005, originally change SQL2005, after using SQL2000 development with computer can normal insert, modify, such as operation, but the program is placed within the local area network (LAN) but only the insert, modify, also does not have any error, connecting the crystal reports print is empty, but it is strange that there are several modules, in the same program problem is one of the module, other modules is normal, the problem of module is normal before, recently to regenerate after the strange problems, I don't know what reason be? Is there a friend met? Thank you very much!

CodePudding user response:

Through what way to connect to the database, modify the data statement is?

CodePudding user response:

reference 1st floor zhuxingyu2011 response:
through what way to connect to the database, modify the data statement is?

The Public Function exesql (ByVal SQL As String) As the ADODB library you
SQL=Trim $(SQL)
Set the conn=New ADODB. Connection
The Set RST=New ADODB. You
Conn. The ConnectionString="DSN=TIME; UID=sa; The PWD=1234
"Conn. Open
The Set RST. ActiveConnection=conn
RST. LockType=adLockOptimistic
RST. CursorType=adOpenKeyset
RST. The Open SQL
The Set exesql=RST
The Set of RST=Nothing
Set the conn=Nothing
End the Function
I use the following procedure call
EditSQL="UPDATE GongZuoRenWuDanNewVersionTble SET PiaoHao='" & amp; Trim (Text1. Text) & amp; "'
"The Set of MRC=exesql (EditSQL)
MsgBox "successfully saved!" , vbOKCancel + vbInformation, "success tip!"

CodePudding user response:

'try it like this:
EditSQL="UPDATE GongZuoRenWuDanNewVersionTble SET PiaoHao='" & amp; Trim (Text1. Text) & amp; "'
"Conn. Execute EditSQL
  • Related