Home > Software engineering >  How to add parsdoxi database insert data
How to add parsdoxi database insert data

Time:10-14


Option Explicit
Dim objConn As ADODB. Connection
Mand Dim objCmd As ADODB.Com
Dim objRset As ADODB. You
Const ParaConn="DSN=ParaDSN"

Private Sub Form_Load ()
The Set objConn=New ADODB. Connection
ObjConn. CursorLocation=adUseClient
ObjConn. Open ParaConn
End Sub

Private Sub add _Click ()
ObjConn. Execute (" insert into db200712. DB values (' "& amp; Trim (Text1) & amp; "')")
End Sub
This code should be how to change, have no idea, please give advice or comments

CodePudding user response:

Public () Function CNN As ADODB. Connection
Set the CNN=New ADODB. Connection
CNN. Open "the Provider=MSDASQL. 1; Persist Security Info=False; Data Source=Paradox7; Initial Catalog=D: \ my program \ material
"End the Function
Private Sub add _Click ()

CNN. Execute (" insert into db200712. DB values (' "& amp; Trim (Text1) & amp; "', '" & amp; Trim (Text2) & amp; "')")
End Sub


This also is wrong, prompt operation must have an updateable query
Consult everybody how to change

CodePudding user response:

Private Sub Command1_Click ()
Adodc1. The ConnectionString="Provider=MSDASQL. 1; Persist Security Info=False; Data Source=Paradox7; Initial Catalog=D: \ my program \ material
"Adodc1. RecordSource="select * from db200712. DB"
Adodc1. Refresh
The Set MSHFlexGrid1. The DataSource=Adodc1
Adodc1. You. AddNew
Adodc1. You. Fields (" plength ")=Text1
Adodc1. You. Fields (" pdate ")=Now
Adodc1. You. Update
Adodc1. Refresh

End Sub
I tried this method, carry out to Adodc1. You. Update and prompt operation must use an updateable query, everybody to help solve, thank you very much, my program has sent this step is completed, solve immediately send points

CodePudding user response:

Try:

CNN. Execute (" insert into db200712. DB (plength, pdate) values (' "& amp; Trim (Text1) & amp; "', '" & amp; Trim (Text2) & amp; "')")


CodePudding user response:

Or no, prompt syntax errors

CodePudding user response:

May your database engine does not support external database update, in a way of connection,
  • Related