|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hello,
I code in VBA and I am trying to execute a "select" query but it gives me all sorts of error. Here is the code: Dim db As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String Set db = CurrentDb strSQL = "SELECT Sponsor FROM tblActivity WHERE tblActivity.NameoftheActivity = '" & Camping & "'" Set rs = db.OpenRecordset(strSQL) rs.Close db.Close Please tell me what is wrong. Any help will be extremely appreciated. |
|
#2
|
|||
|
|||
|
What errors do you get?
Do you have the right reference libraries? Go to View - Object Browser in your VBA session and type in the keywords database and recordset. Check which libraries they are in and then go to Tools - References and check you have those libraries selected. I've had similar problems myself with this. |
|
#3
|
|||
|
|||
|
Just cant get it to work
I am still getting error :
Too few parameters. Expected 1. I have checked the libraries and they are right.... I have tried all possible ways of editing the select query looking at the web...but no luck. I am sure that it is something to do with the syntax of the select query. Anyone with any ideas? thanks |
|
#4
|
|||
|
|||
|
Often this error is caused by a misspelled column name in your sql string.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#5
|
|||
|
|||
|
What is your database engine?
Please specify what is your database engine?
I think you have to try for first these queries directly on database (Query Analyzer)... if this is fine then this works on your app to... |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Please help:Select query problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|