querying access databases

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • marsoa5
    Forum Member
    • Nov 2006
    • 25

    querying access databases

    Hi guys, quick question for you. I have a access database and right now its not doing what i want it to do. I would like it to add the contents of column "Question" to listbox names "answers" but i need it to do it depending on the Model selected from a combobox. I cant tell what is wrong in this code, it seems the string that is pulling the text from the combobox may be stopping the query... any ideas on this?

    Model = ComboBox.GetText("Model");


    strDbPathAndName = "AutoPlay\\Docs\\Customer Service.mdb"
    DBOpen("Provider=Microsoft.Jet.OLEDB.4.0; Data Source="..strDbPathAndName)

    DBExec("select "..Model.." from Questions")
    t = DBRow()
    while t.Question do
    ListBox.AddItem("Answers", t.Question.. "");
    t = DBRow()
    end



    thanks
  • Dermot
    Indigo Rose Customer
    • Apr 2004
    • 1791

    #2
    Try this

    Code:
    DBExec("SELECT Question FROM Questions WHERE Model = '"..Model.."'" )
    Dermot

    I am so out of here :yes

    Comment

    • marsoa5
      Forum Member
      • Nov 2006
      • 25

      #3
      Dermot
      thanks!! it worked!!
      Dermot to the rescue!!

      Comment

      Working...
      X