Zdravim,
mam taky problem.
Mam modul a formular s niekolkmi textboxami, ktorych obsah chcem ulozit do databazy v accesi. Databaza je spojena s programom cez DSN a ODBC
Modul:
Public cn As rdoConnection
Sub main()
Set cn = rdoEnvironments(0).OpenConnection(dsName:="NovaDatabaza", Prompt:=rdDriverNoPrompt)
FormMain.Show
End Sub
Formular:
Private Sub cmdUlozit_Click()
Dim strSQL As String
strSQL = "INSERT INTO Pracovnik "
strSQL = strSQL & "(meno, priezvisko, titul, plat, poznamka) VALUES ("
strSQL = strSQL & "'" & Text1.Text & "', '"
strSQL = strSQL & Text2.Text & "', '"
strSQL = strSQL & Text3.Text & "', '"
strSQL = strSQL & Text4.Text & "', '"
strSQL = strSQL & Text5.Text & "');"
cn.Execute strSQL, rdExecDirect
Unload Me
End Sub
A ked to spustim a skusim nieco ulozit, tak sa objavi chybova hlaska
a ked dam debug, tak mi oznaci riadok s cn.Execute.Run-time Error 40002:
2205: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria exxpression.
Kde je chyba?