Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - nrh7

#1
Excellent!

Thank you very much!
#2
This one works:

READ (CHAN,KEY="!UPDATE [WMPOS].[dbo].[D_INVENTORY] SET ITEM_NAME = 'BLEH' WHERE ITEM_ID_ORIGINAL = '3M115'")

But it gives me an END of file error afterwards, which I think I can just skip it with an extra code on errors.
#3
Greetings again!, Been a while, this project has been renewed and I still need to figure out this part.
The whole point of thise project is to use iNomands to make a sort of webapp that connects to the client database on SQL Server.

These are a few things I tried, because actually the urgent thing now is to UPDATE a record rather than make a new entry (for now)

The code goes like:

LET V1$="BLAH BLAH"
LET V2$="3M115"
OPEN (CHAN,OPT=";USER=pvx;PSWD=pvx123@123@;Connect='Provider=SQLOLEDB;';CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\SQLEXPRESS"

((EDIT: does that "UPDLOCK" line in the previous line have anything to do with preventing updating records?))



These attempts failed trying the INSERT INTO and UPDATE

WRITE RECORD (CHAN,KEY="!INSERT INTO [WMPOS].[dbo].[D_INVENTORY] ITEM_NAME ='"+V1$+" ' WHERE ITEM_ID_ORIGINAL ='"+V2$+"'")

WRITE RECORD (CHAN,KEY="!UPDATE [WMPOS].[dbo].[D_INVENTORY] SET ITEM_NAME ='"+V1$+" ' WHERE ITEM_ID_ORIGINAL ='"+V2$+"'")

Any hints on how to make that proper line code?

Thanks a bunch!!!
#4
Neat, I'll try that thanks!
#5
Ok, stuck again  :o

I'm using the following code to read data from SQL Server DB using ADO:
READ (CHAN,KEY="!SELECT [ITEM_ID],[ITEM_NAME],[ITEM_ID_ORIGINAL] FROM [WMPOS].[dbo].[D_INVENTORY] WHERE ITEM_ID_ORIGINAL ='"+VALUE$+"'")F1$,F2$,F3$

Works well, it brings the item data, now I need to modify say, the name variable ITEM_NAME, how can I write/remove from SQL DB using ADO?

I tried to use the UPDATE SQL command instead of SELECT but it doesn't work.

I can read already, I need to be able to:
Write New Record
Update Existing Record
Delete Record

Thanks for the help team!
#6
Nevermind guys!
Ado is working well with chrome, its just the command "print" doesnt show anything but i can display information to a multiline or msgbox just fine.

So I guess im set for now, thanks!!!
#7
This is the final product:

00041 LET CHAN=HFN
00042 MULTI_LINE READ MULTILINE.CTL,Y$
00043 OPEN (CHAN,OPT=";USER=pvx;PSWD=pvx123@123@;Connect='Provider=SQLOLEDB;';CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\SQLEXPRESS"
00044 READ (CHAN,KEY="!SELECT [ITEM_ID],[ITEM_NAME],[ITEM_DESCRIPTION],[ITEM_ID_ORIGINAL],[LAST_UNIT_COST] FROM [WMPOS].[dbo].[D_INVENTORY] WHERE ITEM_ID_ORIGINAL ='"+Y$+"'")C1$,C2$,C3$,C4$,C5$
00045 PRINT C1$
00046 PRINT C2$
00047 PRINT C3$
00048 PRINT C4$
00049 PRINT C5$
00050 PRINT "========================================="
00051 CLOSE (CHAN)
00052 RETURN

It works wonderful because I input the internal code in the screen and run the code and it prints the info about the internal id.

Runs smooth!!! Finally....

However when I tried to run that same window via inomads it did not run nor it gave me any errors.

What changes do I have to make to inomads so that it can run, I use EZWeb Server on local network and google chrome.

THANKS GUYS!
#8
I created another user in the SQL Server called
pvx with password pvx123@123@ that is NOT an admin user like "sa"

I used the following code:
OPEN (CHAN,OPT=";USER=pvx;PSWD=pvx123@123@;Connect='Provider=SQLOLEDB';DB=WMPOS;")"[ado]SADI\SQLEXPRESS"
Then got this:
Error 15 - Dump = OSerr: HY000: Cannot open database "WMPOS" requested by the login. The login failed.

Then used:
OPEN (CHAN,OPT=";USER=pvx;PSWD=pvx123@123@;Connect='Provider=SQLOLEDB;';CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\SQLEXPRESS"

It gave no error, so I'm assuming it connected correctly, I will try to read any record now and show it on screen.
Let's see how it goes.
#9
Extra info:

The developer uses this connection string on VisualBasic

MSDASQL;DRIVER={SQL Server};SERVER=EliteBox\SQLEXPRESS;trusted_connection=no;user id=sa;password=sa123@123@;database=WMPOS;

He asks me that IF I can connect to the database as a whole instead of trying to connect a specific table but that answer I do not know.

I shared his code so maybe it gives us a hint.
#10
Yes it does, with SADI\SQLEXPRESS gives log in error, I will follow up with the software developer on the user/pass of sql server.


Side question, when I open the SQL Server manager it is set up so that I can use the Windows Authentication as log in method, so I use the PC name/password to connect to the database, can ADO command be used in such way too?
That it connects using my windows PC username/pass instead of the sa/sa123@123@ user?
#11
Greetings

This literal code:

OPEN (CHAN,IOL=*,OPT=";USER=sa;PSWD=sa123@123@;Connect='Provider=SQLOLEDB;';DB=WMPOS;KEY=PK_D_INVENTORY;CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI;D_INVENTORY"

Still gave me the error 15 but with this dump information instead:

Error Status
 Error #15: Operating system command failed
 [Last OS err:No such file or directory]

Error Info
   Err: 15
   Erx: 150000
   Ret: 258
   OSerr: HY000: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
   Program: C:\CentralDrugInventory\test
   EntryPoint: 0
   Stno: 251
   Obj: 0
   Lfa: 61
   Lfo: 124
   LastPath: [ado]SADI;D_INVENTORY
   LastWinErr: 0
   Module: pvxado.c
   Line: 2063
   CTL: 10001

===================================================

Would this have anything to do with the ODBC License? I have yet to activate that, not sure where or how.

Or maybe it has to do with maybe the directories?

PVX is on C:\
The project is on C:\InventoryApp
and the SQL Server is installed on C:\Program Files\Microsoft SQL Server

I will check about the user and password as you mentioned though.

Thank you
#12
Thanks for the info!

Playing around with the command you shared, I tested many codes but im sharing the following codes, all gave error 15:

OPEN (CHAN,IOL=*,OPT=";USER=sa;PSWD=sa123@123@;Connect='Provider=SQLOLEDB;';DB=WMPOS;KEY=key_field;CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\Lenovo;D_INVENTORY"
! DUMP -  OSerr: HY000: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

OPEN (CHAN,IOL=*,OPT=";USER=sa;PSWD=sa123@123@;Connect='Provider=SQLOLEDB;';DB=WMPOS;KEY=key_field;CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI;D_INVENTORY"
! DUMP - OSerr: HY000: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

OPEN (CHAN,IOL=*,OPT=";USER=sa;PSWD=sa123@123@;Connect='Provider=SQLOLEDB;';DB=WMPOS;KEY=key_field;CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\SQLEXPRESS;D_INVENTORY"
! DUMP -  OSerr: HY000: Login failed for user 'sa'.

OPEN (CHAN,IOL=*,OPT=";USER=sa;PSWD=sa123@123@;Connect='Provider=SQLOLEDB;';DB=WMPOS;KEY=key_field;CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\SQLEXPRESS;D_INVENTORY"
! DUMP -  OSerr: HY000: Login failed for user 'sa'.

OPEN (CHAN,IOL=*,OPT=";USER=sa;PSWD=sa123@123@;Connect='Provider=SQLOLEDB;';DB=SADI\SQLEXPRESS;KEY=key_field;CONCURRENCY=LOCK;EXTROPT=(UPDLOCK)")"[ado]SADI\SQLEXPRESS;D_INVENTORY"
! DUMP -  OSerr: HY000: Login failed for user 'sa'.

=============================================================================

The SQL Server and PVX are on the same machine for this test.

Computer Name: SADI
Local PC User: Lenovo (no password)

SQL Server User: sa
SQL Server Pass: s123@123@

SQL Server Name: SADI\SQLEXPRESS
Database Name:  WMPOS
Table Name: D_INVENTORY

Not sure what the "key_field" is but the primary key for D_INVENTORY is PK_D_INVENTORY.

I'm still missing something  :'(


Thanks for all the help
#13
Greetings, I excuse myself if this is not the right forum to ask this.

One of my client has seen the power of iNomads and they gave me a request, to make iNomads panels that open, read and update a database on their Microsoft SQL Server database.

I'm VERY newbie on this topic, barely have managed to run iNomands on a local network, so this client has a desktop software made on Visual Basic 6, but they loved how easily I managed to open pvx panels on Google Chrome via iNomads.

So, they installed their SQL Server database in my laptop, I was looking at the manual and ended up reading about the ADO command but I haven't been able to connect to the SQL Server database, everything I tried gives me an error 15.

For this test I'm only trying to OPEN and CLOSE it without actually reading anything, just trying to simply open it but it's not working:
The commented lines (starting with ! ) are all the examples I've tried and failed.

SADI\SQLEXPRESS is supposed to be the server name, dbo.D_Inventory is the Table I want to connect to (open then close)

LET CHAN=HFN
! OPEN (CHAN,OPT="CONNECT='Provider=SADI\SQLEXPRESS'")"[ADO]SADI\SQLEXPRESS;dbo.D_Inventory"
! OPEN (CHAN)"[ADO]SADI\SQLEXPRESS"
! OPEN (CHAN)"[ADO]SADI\SQLEXPRESS[dbo.D_INVENTORY][]"
! OPEN (CHAN)"[ADO]SADI\SQLEXPRESS.WMPOS[dbo.D_INVENTORY][]"
! OPEN (CHAN,IOL=*)"[ tag ] SADI\SQLEXPRESS.WMPOS ; dbo.D_INVENTORY [;fileopt ]"
CLOSE (CHAN)

I know nothing about this, I also read about ODBC but I haven't even been able to learn where to activate the ODBC license, let alone use that feature.

I got this far by reading the "Microsoft SQL Server Interface" part of the pvx manual.

For now it's just OPEN CLOSE, after is, OPEN, READ (a record), WRITE (to update it) then CLOSE.


Thanks for any help, I may be able to sell a few Web and Wayfarer Licenses if I can pull this off.
#14
iNomads / Re: Accesing software from external IP
August 27, 2024, 08:47:16 PM
The public IP is definitely dynamic, I will try to use the freedns method.
Thanks a lot both of you.
#15
iNomads / Accesing software from external IP
August 23, 2024, 12:17:32 PM
Greetings.

I'm trying to learn inomads since my clients are in need of it's benefits.
So far, I managed access the panels from Google Chrome on a phone, tablet and Handheld/PDA, worked wonderful.
However now I need to learn how to make it accessible from an external network.

For my local network test I used the following.
- Main program/panels etc, installed on a device at 10.0.0.71
- The EZ webserver runs in that machine using: *plus/spawn *ezweb/server -bkg -arg 8080
- On any mobile device connected to the same network I just open Chrome and type 10.0.0.71:8080 on URL and the app opens well.

However for accessing it from an external IP/Device not part of that local network, say personal phone.
I'm trying to do so using port forwarding on the modem that belongs to the local network.
- The modem locally has am IP 10.0.0.138
- Has a public IP of 72.50.4.97 or thats what google says.

Problem is when I type 72.50.4.97:8080 from an external device it doesn't land on the program, possibly because the power forwarding is not set correctly.

The modem in question has the following fields when setting up portforwarding:
- WanPort
- LanPort
- Internal Client (this is for the IP 10.0.0.71 where the program is)
- Protocol (Used both TCP/UDP)
- Enable Mapping (with a checkbox, not sure what this is)
- Wan Connection List (gives me a dropbox with 2 options, probably the names of the wireless signals)

I'm tried filling WanPort and LanPort with port 8080 or port 80, none have worked.

So then, I'm not sure where I'm missing what I'm missing, any hints?

The goal simply is to have access the panels via Chrome/Edge from an external network device.

Thanks a lot!