locked
For at least one necessary perameter was no value given RRS feed

  • Question

  • User194554415 posted
     Dim con As New OleDbConnection
            Dim cmd As New OleDbCommand
            Dim reader As OleDbDataReader
            Dim out As String = ""
            con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=<here was the Path to my File, but i have blanked it>;" & "Persist Security Info=False"
            cmd.Connection = con
            cmd.CommandText = "SELECT Doktoren.Bezeichnung, Doktoren.Sitze FROM ( Verteilung INNER JOIN Doktoren ON Doktoren.ID=Verteilung.Dr_ID ) INNER JOIN Dienste ON Dienste.ID=Verteilung.Dienst_ID ORDER BY Dienste.Zeit"
            Try
                con.Open()
                reader = cmd.ExecuteReader(CommandBehavior.Default)
                Do While reader.Read()
                    out += reader("bezeichnung") & " # " & reader("Dr_ID") & " # " & reader("sitze") & vbCrLf
                Loop
                reader.Close()
                con.Close()
                Console.Write(out)
            Catch ex As Exception
    
            End Try

    I Get the Error Message from the title, when executing cmd.ExecuteReader(...)

    Thanks in Advance

    BLDL

    Wednesday, January 27, 2016 6:43 PM

Answers

  • User-821857111 posted

    Double check the field and table names in your SQL. There may well be a typo.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 27, 2016 7:08 PM

All replies

  • User-821857111 posted

    Double check the field and table names in your SQL. There may well be a typo.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 27, 2016 7:08 PM
  • User194554415 posted

    Well it was something similar. I renamed a Field but still used the old version in my script.

    Thanks for your helpLaughing

    BLDL

    Wednesday, January 27, 2016 8:15 PM