ADO insert problem in VB6 database ms access 2000?

Private Sub datacheck() Dim rs As New ADODB.Recordset Dim Conn As New Connection Dim strsql As String Conn = "DSN=DSNNRHM" Conn.Open strsql = "SELECT MAX (phc_id) FROM phc_master " rs.Open strsql, Conn, adOpenDynamic, adLockReadOnly data = rs.Fields(0) add1 = data + 1 add2 =... show more Private Sub datacheck()
Dim rs As New ADODB.Recordset
Dim Conn As New Connection
Dim strsql As String
Conn = "DSN=DSNNRHM"
Conn.Open
strsql = "SELECT MAX (phc_id) FROM phc_master "
rs.Open strsql, Conn, adOpenDynamic, adLockReadOnly
data = rs.Fields(0)
add1 = data + 1
add2 = blockcombo.ItemData(blockcombo.ListIndex...
Conn.Close
Conn.Open
strsql = "INSERT INTO phc_master (phc_id,phc_name,block_id,status) VALUES ( add1 ,'" & phcname.Text & "',add2,'Y' )"
rs.Open strsql, Conn, adOpenDynamic, adLockReadOnly
Conn.Close
MsgBox "record saved successfully"
phcname.Text = ""
phcname.SetFocus
End Sub
this is giving error
[Microsoft] [ODBC Microsoft Access driver] Too few parameters Expected 2
plz give me code
3 answers 3