Results 1 to 4 of 4

Thread: I can't open my database in web server

  1. #1
    Member
    Join Date
    Oct 2012
    Location
    México city
    Posts
    34

    I can't open my database in web server

    Hello I star making a web program in javascrip, but if I use

    tx4.value = Lianja.evaluate("busca1('"+cJSON+"')");

    the busca1.prg have this

    parameter p1
    oJSON = json_decode(p1)
    busca1 = alltrim(oJSON.correo1)
    open database dsigner
    if .not. used(usuarios)
    use usuarios in 0
    endif
    select usuarios
    locate for correo = busca1
    if eof()
    pato = "No autorizado"
    else
    pato "Si puede pasar"
    endif
    return etos(pato)

    I see I cant open my database . How can I do this ?

    Thanks for the help

  2. #2
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,942
    Hi,

    you need to

    if database() <> "mydatabase"
    open database mydatabase && substitute your database name
    endif
    at the top of your code. It has no way of knowing where the busca table is otherwise.

    Now, you could also

    use mydatabase!busca
    instead. If you need the database open for other operations, however, open the database on its own.

    Hank

    PS: you don't need the periods around NOT. Here's a link to VFP operators: https://riptutorial.com/visual-foxpr...7625/operators

  3. #3
    Member
    Join Date
    Oct 2012
    Location
    México city
    Posts
    34
    Hello Hank.

    Thanks for the solution this works perferct

    Regards

    Gontran Noble V.

  4. #4
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,942
    Hi Gontran,

    That's great.

    Now check out save/restore datasession: https://www.lianja.com/doc/index.php/SAVE_DATASESSION

    Where there are repeated calls to a backend service based up multiple tables, this can eliminate a bit of overhead after the first call.

    Hank
    Last edited by HankFay; 2019-05-24 at 12:02.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us