ODBC database access

Jan Schenkel janschenkel at yahoo.com
Sat Feb 12 07:50:15 EST 2005


--- Steve Paris <lists at paris-saigon.com> wrote:
> I have been tinkering with Revolution and lurking on
> this list for some
> time. The willingness of many on this list to help
> both new Rev users,
> and suggest solutions to more complex issues
> encounted by more
> experienced Rev users, is truly impressive.  I did
> quite a bit of work
> in Supercard a few years ago, and using Transcript
> has the same
> "enjoyable way to program"  factor that I loved
> about  Supercard. Now I
> am working on a more substantial database client,
> and going through the
> learning curve for revDB. I have struck a problem
> that I haven't been
> able to resolve, but maybe someone with much more
> experience than me on
> this list has seen this before:
> 
> The client accesses an Access database via ODBC. ( I
> know, I know. It
> will be ported to something more powerful db later,
> but at this point I
> need to use Access). I have used the softwaredbdemo
> as a starting point.
> I can make the connection OK, but even the simplest
> select statement
> returns an error. For example, if I use this
> statement to create the sql:
> put "SELECT * " & cr & \
>       "FROM Students " & cr & \
>       "WHERE Students.StudentID = " & quote &
> studentID & quote into tSQL
> 
> and execute the query, I get this error:
> [Microsoft][ODBC Microsoft Access Driver]Too few
> parameters. Expected 1.
> 
> The Microsoft site says this occurs if a field name
> is incorrect. But I
> have checked and double checked, used a list of
> fields as opposed to the
> *, copied the SQL out of Access directly, tried
> different punctuation...
> but get the same error.
> 
> I must be missing something fundamental. Any
> pointers toward a
> resolution would be greatly appreciated.
> 
> Steve
> 

Hi Steve,

Welcome to Revolution -- you'll find it a great tool
for interfacing with databases, even if it has a bit
of a learning curve when you're used to doing this
'the hypercard way' with backgrounds and cards.

Try using single quotes for the strings in your
SQL-suery, as in the following snippet :
--
put "SELECT * " & cr & \
    "FROM Students " & cr & \
    "WHERE Students.StudentID = '" & \
    studentID & "'" into tSQL
--

Hope this helped,

Jan Schenkel.

=====
Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 



More information about the use-livecode mailing list