|
-
Jul 18th, 2005, 10:55 AM
#1
Thread Starter
Lively Member
This is "really" newbie stuff, but....
Hi Everybody,
I need to scan a rather short mdb table ( It's a list of city names, about 20 records) to see if a city name exists in the table. The searchKey is contained in a combobox.Text property.
Building an SQL request is whats making me crazy because of its string manipulation. (I think)
Here's the code I have worked out so far, along with Visual Basic-6 complaint:
Private Sub SeeCmbCity()
' Finds a record to match city name, or allows for a new record
' to be entered into the city table
Dim rsData2 As ADODB.Recordset
Dim cString As String
cString = Trim(cmbCust(1))
Set rsData2 = New ADODB.Recordset
rsData2.Open "SELECT * FROM city where city=" & cString, cnDB,
adOpenDynamic, adLockOptimistic
'
' VB6 ends with a run-time error. something about too few parameters.
'
End Sub
So I have two questions really...
(1) What have I done wrong with the rsData2.Open statement?
(2) Is it smart to place all data in a single file like mdb does. Clipper would have maintained seperatye databases.
Thanks,
-Paul-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|