MS SQL

Rodney Green green.rodney at gmail.com
Tue Apr 22 20:58:48 EDT 2014


It still hangs after I changed the line of code. Here's the entire script
for the button. Also, this is a MS SQL server.

Thanks again.

*on* mouseUp



   *local* tDatabaseID

   *local* xQuery

   *local* rez



   *put* "Driver={Actual SQL
Server};Server=xxx.xxx.x.x;Database=AT2005_Premier;UID=xxxxxx;PWD=xxxxxx;"
into tString

   *put* revOpenDatabase("ODBC", tString, "", "", "") into tDatabaseID

   *put* tDatabaseID

   *if* tDatabaseID is not a number *then*

      *answer* "Not connected"

   *else*

     *put* revDataFromQuery(,,tDatabaseID,"SELECT * FROM Rep_Offices") into
fld"results"

   *end* *if*

   *# put revDatabaseConnectResult(tData) *

   *#put revQueryDatabase(tData,"SELECT * FROM OfficesCategory")*



*end* mouseUp


On Tue, Apr 22, 2014 at 7:49 PM, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> I don't know if it's just your email client but what I'm seeing is an
> asterisk * around the words get, put and return which shouldn't be there.
> Although it should work I'd also remove the first two parameters, tab and
> return, just to simplify things until you figure out exactly what's wrong.
> The most basic query should look like this:
>
> put revDataFromQuery(,,tDatabaseID,"SELECT * FROM Rep_Offices") into
> fld"results"
>
> HTH
>
>
> On Wed, Apr 23, 2014 at 2:40 AM, Rodney Green <green.rodney at gmail.com
> >wrote:
>
> > Hello,
> >
> > It's my first time using LC and MS SQL in a project. I can connect and
> > receive a connection ID. However, I can't seem to pass any SQL commands.
> I
> > try this:
> >
> > *get* revDataFromQuery(tab,*return*,tDatabaseID,"select top 3 * from
> > [dbo].[Rep_Offices]")
> >
> > or this:
> >
> > *put* revDataFromQuery(tab,*return*,tDatabaseID,"select * from
> > Rep_Offices")
> > into "dbResults"
> >
> > or this:
> >
> > *put* revDataFromQuery(tab,*return*,tDatabaseID,"select top 3 * from
> > [dbo].[Rep_Offices]") into fld "results"
> >
> > Any SQL causes livecode to freeze. I've tried different variations of the
> > query and no luck. If I put in random chars for the SQL statement then
> the
> > odbc driver gives an error.
> >
> > Can anyone point me in the right direction?
> >
> > Thanks.
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the Use-livecode mailing list