Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: VB and Sql


Message #1 by Ntshalintshali Neliso <Ntshalintshalin@f...> on Sat, 13 Oct 2001 18:40:17 +0200
> -----Original Message-----
> From: Michael Wong (Supernet) [mailto:go2net@p...]
> Sent: 14 October 2001 06:43
> To: sql language
> Subject: [sql_language] RE: VB and Sql
> 
> 
> Hi Neliso,
> 
> Try this...
> 
> Dim strHobby As String
> Dim strSQL As String
> 
> strHobby = "Working overtime"
> strSQL = "Select *, ' " & strHobby & "' As hobby From employees"
> 
> ' Assuming you have setup a connection and recordset object...
> 
> Set objRS = objCN.Execute(strSQL)
> 
> Happy programming
> 
> Michael Wong
> 

Michael's solution is fine unless you meant that you have in VB a different
hobby for each employee.  Then you will need to decide how you relate one to
the other and do a more complex select.

  Return to Index