
Using INNER JOIN with SQL
sorry, don't know about spanish versions. One other tip is to use
variables and then Debug.Print statements so you can take a look at
the entire string in the immediate window. a simple "debug.print
varcon" might point up where the connection is failing.
-- Mary
Microsoft Access Developer's Guide to SQL Server
http://www.amazon.com/exec/obidos/ASIN/0672319446/mcwtechnologies/
On Mon, 29 Jan 2001 16:42:53 -0300, "Fernando Flores"
Quote:
>Mary,
>Thanks for the help, Ill try that way. I have seen the book at the site you
>wrote in the e-mail, Will it help me
>with this problem ?, remember that Im using data access but with Visual
>Basic, no directly SQL
>( I mean simple SQL instruccions with Vb code to get data access ), and do
>you know where to look for a
>spanish version ?
>Thank you again
>Best regards,
>Fernando
>> The problem you are having is not with your VB code, but with your SQL
>> statement, which is parsed by the database engine of whatever RDBMS
>> you are using. The best way to debug SQL statements is by using the
>> tools that come with the product -- the query window for Access, the
>> Query Analyzer with SQL Server. You'll also have to handle the issue
>> of delimiters for non-numeric variables--each engine supports slightly
>> different syntax.
>> -- Mary
>> Microsoft Access Developer's Guide to SQL Server
>> http://www.amazon.com/exec/obidos/ASIN/0672319446/mcwtechnologies/
>> On Mon, 29 Jan 2001 12:59:58 -0300, "Fernando Flores"
>> >Hello everybody,
>> >Im new in this section (I mean programming with visual basic language)
>> >and I have problems when using the following code. A message box like
>> >"sintax error using INNER JOIN - Code no 3135" appears.
>> >Here is the code:
>> >Private Sub Form_Load()
>> >Set db = OpenDatabase("c:\trueno\trueno.mdb")
>> >DBGrid1.AllowUpdate = False
>> >varcons = Form2.DBGrid1.Columns(0)
>> >varcon = "select [prodprov.codigo], [prodprov.cod-prov],
>[Proveedores.Desc]"
>> >varcon = varcon & " FROM prodprov INNER JOIN Proveedores ON
>> >[prodprov.cod-prov] = [Proveedores.Cod-Prov]"
>> >varcon = varcon & " WHERE prodprov.codigo = " & varcons
>> >Data1.RecordSource = varcon
>> >Data1.Refresh
>> >Sub
>> >I want to join two tables containing a same field each one.
>> >I have passed fours day thinking of it without succeded.
>> >Could anyone help me with this code, please.?
>> >Sorry for my bad english, Im from Argentina
>> >Thank you