querystring = "Select AccomodationName from MST_ONSITEACCOMMODATION where CityName=" & Chr(39) & cityname & Chr(39)
conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=.;Initial Catalog=Test;"
conn.Open
rst.Open querystring, conn, adOpenStatic
With ComboBox7
.Clear
Do While Not rst.EOF
.AddItem rst![AccomodationName]
rst.MoveNext
Loop
End With
rst.Close
conn.Close
querystring = vbNullString
Set rst = Nothing
Set conn = Nothing
conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=.;Initial Catalog=Test;"
conn.Open
rst.Open querystring, conn, adOpenStatic
With ComboBox7
.Clear
Do While Not rst.EOF
.AddItem rst![AccomodationName]
rst.MoveNext
Loop
End With
rst.Close
conn.Close
querystring = vbNullString
Set rst = Nothing
Set conn = Nothing