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
Neat, I'll try that thanks!
#2
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!
#3
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!!!
#4
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!
#5
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.
#6
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.
#7
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?
#8
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
#9
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
#10
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.
#11
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.
#12
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!

#13
Ah great thanks for the reply.

I "think" I saw somewhere some day to either READ or SELECT from a data file as if they were numeric but I don't really remember where.

If not I'll have to try some different option like PAD.
#14
Programming / Re: Why use PVX?
July 11, 2024, 02:13:14 PM
Probably out of topic but I agree with this comment:

Cedric said "Also, it's hard to seduce young developers to join the team since PVXPLUS has an old school approach that's really different to all the other popular "web based" technologies.  There's not a lot of documentation or info about the language that makes it hard for them to learn."
-------------------------------------------
My story is that I was technically forced to learn PVX because the only one left in the company who knew PVX is about to retire, so technically PVX was my first programming language, I knew a very little about visual basic but only dealt with it doing macros inside excel sheets. with copy/pasted examples from the internet, something you can't really go with PVX.

Problem is the one who taught me know way less about PVX than I learned in a few weeks of diving in https://manual.pvxplus.com/. (of course, with the basics he taught me)

The manual is no "training material" at all, it gives examples but they're not really newbie/student friendly, it is what it is, just a manual as if I was trying to understand a car's manual, show's me how it works but doesn't make me a mechanic.

So the little I have learned by trial and error has been enough to make some tools our clients and THAT's precisely why I decided to stick with PVX, I was shown visual studio and python but I kind of like the simplicity of PVX even though I know it's a LOT MORE simple than what I know.

I would reeeally like to learn about android apps and iNomads, but right now I'm burned with trial and error/self teaching.

So! I finally decided to join the forums, maybe here I can get some tips make the most our of PVX.

But back to topic, it's kind of hard to learn PVX as your first programming language, HOWEVER I do find it very simple and quite amazing if used well.

Either way, I'm trying to get as many clients as I can and use PVX in them all, I don't find myself replacing it, instead learning more from it along the way.
#15
Hello team!

I'm having a little doubt in something I'm trying to do.

I have this small code:


02150 LIST_BOX LOAD ACCOUNTS.CTL,""
02190 LET CH1=HFN
02200 OPEN (CH1,IOL=*)"dta_ACCOUNTS"
02230 SELECT IOL=ACCOUNTS_IOL FROM (CH1),KNO=1
02261 LIST_BOX LOAD ACCOUNTS.CTL,0,STR(KEY)+SEP+ACCOUNTNUMBER$+SEP+ACCOUNTNAME$
02270 NEXT RECORD
02280 CLOSE (CH1)
02330 RETURN

I tried to run this code to load the listbox in order of account number hence the KNO=1, that worked well, BUT it's loading the listbox in alphanumeric manner since the account number is an string variable, like:

300
3100
315

Leaving the variable as string, is there a way to read the file as if it where numeric so that it sorts the data in numeric order when filling the listbox?

Like:
300
315
3100

Thanks a lot!