Синтаксическая ошибка insert into statement
Public Class Biochemistry Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Dim conn As New OleDb.OleDbConnection Dim connStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Buthdatabase.accdb;Persist Security Info=False" Dim cmd As New OleDb.OleDbCommand Try conn.ConnectionString = connStr conn.Open() cmd.Connection = conn cmd.CommandText = "INSERT INTO Biochemistry ([Hospital Number],[Path No (Lab Number)],[Patient's Name],[Other's Name],[Age],[Sex],[Ethnic],[Clinician],[Ward/Dept],[Clinical Summary and Diagnosis],[Materials],[Specimen],[Type of Biochemistry],[Date of Request],[Signature Of Doctor],[Serum Bicarbonate],[Serum Chloride],[Serun Sodium],[Serum Potassium],[Serum Calcium],[Serum Phosphorus],[SGOT],[SGPT],[Serum Amylase],[Urinary Amylase],[Serum Lipase],[Urinary Lipase],[Alkaline Phosphatase],Gamma GPT],[Serum Creatinine],[Serum Urea],[Urinary Creatinine],[Uric Acid],[Serum Cholesterol],[Serum VLDL],[Serum HDL],[Serum LDL],[Serum Triglyceride],[Serum Iron],[Random Blood Sugar],[Fasting Blood Sugar],[2 Hour Post Prandial],[Bilirubin Conjugated],[Unconjugated Bilirubin],[Total Bilirubin],[Serum thymol Turbidity],[Serum Thymol Floculation],[CSF Protein],[CSF Chloride],[CSF Sugar],[Serum Magnesium],[OTHER TESTS]) " & _ "VALUES ([@HospitalNumber],[@PathNo(LabNumber)],[@Patient'sName],[@Other'sName],[@Age],[@Sex],[@Ethnic],[@Clinician],[@Ward/Dept],[@ClinicalSummaryandDiagnosis],[@Materials],[@Specimen],[@TypeofBiochemistry],[@DateofRequest],[@SignatureOfDoctor],[@SerumBicarbonate],[@SerumChloride],[@SerunSodium],[@SerumPotassium],[@SerumCalcium],[@SerumPhosphorus],[@SGOT],[@SGPT],[@SerumAmylase],[@UrinaryAmylase],[@SerumLipase],[@UrinaryLipase],[@AlkalinePhosphatase],[@GammaGPT],[@SerumCreatinine],[@SerumUrea],[@UrinaryCreatinine],[@UricAcid],[@SerumCholesterol],[@SerumVLDL],[@SerumHDL],[@SerumLDL],[@SerumTriglyceride],[@SerumIron],[@RandomBloodSugar],[@FastingBloodSugar],[@2HourPostPrandial],[@BilirubinConjugated],[@UnconjugatedBilirubin],[@TotalBilirubin],[@SerumthymolTurbidity],[@SerumThymolFloculation],[@CSFProtein],[@CSFChloride],[@CSFSugar],[@SerumMagnesium],[@OTHERTESTS]); " cmd.Parameters.AddWithValue("@HospitalNumber", TextBox1.Text) cmd.Parameters.AddWithValue("@PathNo(LabNumber)", TextBox12.Text) cmd.Parameters.AddWithValue("@Patient'sName", TextBox2.Text) cmd.Parameters.AddWithValue("@Other'sName", TextBox3.Text) cmd.Parameters.AddWithValue("@Age", TextBox4.Text) cmd.Parameters.AddWithValue("@Sex", TextBox5.Text) cmd.Parameters.AddWithValue("[@Ethnic", TextBox6.Text) cmd.Parameters.AddWithValue("@Clinician", TextBox7.Text) cmd.Parameters.AddWithValue("@Ward/Dept", TextBox27.Text) cmd.Parameters.AddWithValue("@ClinicalSummaryandDiagnosis", TextBox8.Text) cmd.Parameters.AddWithValue("@Materials", TextBox10.Text) cmd.Parameters.AddWithValue("@Specimen", TextBox39.Text) cmd.Parameters.AddWithValue("@@TypeofBiochemistry", TextBox51.Text) cmd.Parameters.AddWithValue("@DateofRequest", DateTimePicker1.Text) cmd.Parameters.AddWithValue("@SignatureOfDoctor", TextBox11.Text) cmd.Parameters.AddWithValue("@SerumBicarbonate", TextBox21.Text) cmd.Parameters.AddWithValue("@SerumChloride", TextBox22.Text) cmd.Parameters.AddWithValue("@SerunSodium", TextBox20.Text) cmd.Parameters.AddWithValue("@@SerumPotassium", TextBox19.Text) cmd.Parameters.AddWithValue("@SerumCalcium", TextBox18.Text) cmd.Parameters.AddWithValue("@SerumPhosphorus", TextBox17.Text) cmd.Parameters.AddWithValue("@SGOT", TextBox16.Text) cmd.Parameters.AddWithValue("@SGPT", TextBox15.Text) cmd.Parameters.AddWithValue("@SerumAmylase", TextBox14.Text) cmd.Parameters.AddWithValue("@UrinaryAmylase", TextBox13.Text) cmd.Parameters.AddWithValue("@SerumLipase", TextBox9.Text) cmd.Parameters.AddWithValue("@UrinaryLipase", TextBox25.Text) cmd.Parameters.AddWithValue("@AlkalinePhosphatase", TextBox24.Text) cmd.Parameters.AddWithValue("@GammaGPT", TextBox29.Text) cmd.Parameters.AddWithValue("@SerumCreatinine", TextBox28.Text) cmd.Parameters.AddWithValue("@SerumUrea", TextBox30.Text) cmd.Parameters.AddWithValue("@UrinaryCreatinine", TextBox31.Text) cmd.Parameters.AddWithValue("@UricAcid", TextBox32.Text) cmd.Parameters.AddWithValue("@SerumCholesterol", TextBox33.Text) cmd.Parameters.AddWithValue("@SerumVLDL", TextBox34.Text) cmd.Parameters.AddWithValue("@SerumHDL", TextBox35.Text) cmd.Parameters.AddWithValue("@SerumLDL", TextBox36.Text) cmd.Parameters.AddWithValue("@SerumTriglyceride", TextBox37.Text) cmd.Parameters.AddWithValue("@SerumIron", TextBox38.Text) cmd.Parameters.AddWithValue("@RandomBloodSugar", TextBox26.Text) cmd.Parameters.AddWithValue("@FastingBloodSugar", TextBox41.Text) cmd.Parameters.AddWithValue("@2HourPostPrandial", TextBox40.Text) cmd.Parameters.AddWithValue("@BilirubinConjugated", TextBox42.Text) cmd.Parameters.AddWithValue("@UnconjugatedBilirubin", TextBox43.Text) cmd.Parameters.AddWithValue("@TotalBilirubin", TextBox44.Text) cmd.Parameters.AddWithValue("@SerumthymolTurbidity", TextBox45.Text) cmd.Parameters.AddWithValue("@SerumThymolFloculation", TextBox46.Text) cmd.Parameters.AddWithValue("@CSFProtein", TextBox47.Text) cmd.Parameters.AddWithValue("@CSFChloride", TextBox48.Text) cmd.Parameters.AddWithValue("@CSFSugar", TextBox49.Text) cmd.Parameters.AddWithValue("@SerumMagnesium", TextBox50.Text) cmd.Parameters.AddWithValue("@OTHERTESTS", TextBox23.Text) cmd.ExecuteNonQuery() conn.Close() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub End Class
Что я уже пробовал:
Пожалуйста, любезно помогите мне с этой проблемой, я не знаю, что не так
Patrice T
Дайте точное сообщение об ошибке !
Воспользуйся Улучшить вопрос чтобы обновить ваш вопрос.
Чтобы каждый мог обратить внимание на эту информацию.
RickZeeland
И что же это за сообщение об ошибке ?
PIEBALDconsult
Скобки вокруг имен параметров?
Значения ([@HospitalNumber],