Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all 7329 articles
Browse latest View live

Re: PowerBuilder 11.5.1 - Menu alignment has changed

$
0
0

did you accidentally checked the RightToLeft checkbox on the options tab in your window?

 

if i do this then i get something like:


Re: Not printing TIFF when PB-app is offered as a 'Remote App'

$
0
0

It seems like W7 and W10 behaves differently on our code.

 

Our PB app sets the printqueue with a path and filename of the wanted TIFF like so, and it works on W7:

"TIFF Image Printer 10.0,PNtif10,Ne00:C:\temp\tiff001.tif"

 

When doing that in W10, the printerdriver doesn't get it, so I removed the path and file name, leaving the printqueue like "TIFF Image Printer 10.0,PNtif10,Ne00:" and it works.

 

I can't really explain it, but it works.

 

Thanks again for all your help!

Re: Getting Error while parsing the JSON string using ScriptControl

$
0
0

Hi Subrata,

 

The issue is not necessarily with your code, the issue is with the JSON data you are passing in.

 

Your example shows your JSON data having double quotes ... switch those to single quotes.

 

This fails ... {"lastName":"Doe", "firstName":"John"}
This works ... {'lastName':'Doe', 'firstName':'John'}

 

If you look at the link where you copied the script from, you will see there was a note there about JSON using single quotes.

 

Since the JSON string has single quote to represent strings, I use double quotes to pass the JSON string to the JScript function.

 

Stephen

Re: Powerbuilder 12.6 and Alwayson connection SQLSERVER 2014

$
0
0

Try to write the MultiSubnetFailover into the Providerstring.

Something like...

DBParm="Provider='SQLNCLI11', .. ,ProviderString='Database=SDC;MultiSubnetFailover=Yes'"

 

hth

 

Arnd

How to get Delete buffer from external DW

$
0
0

Id like to know if there's a way for getting info from Delete buffer (if exists) in a External DW.

thanks in advance.

Re: How to get Delete buffer from external DW

$
0
0

Hi Mariano;

 

  An external DWO can not have a delete buffer as it is never expected to have updating privileges. That means that you also cannot use an Update () or ReSelectRow () command on a DC/DS that contains the external DWO either.

 

  Workaround: When I need to do this, I build a "fake" table in my development database and build the external DWO from that definition. That makes the DWO "think" it has updating capabilities and thus provides for a Delete Buffer. At run time, the "fake" DWO can still behave like an external DWO by importing its data from a flat file or storing it's data right in the primary buffer declared in the DW painter. However, this version of your "fake" external DWO will now allow you to introspect its Delete Buffer.

 

   Of course, the "fake" table will not be in the production environment. That won't hurt the execution of your "fake" external DWO as long as you do not use a Retrieve ( ), Update, ReselectRow(), etc command. Food for thought.  

 

HTH

Regards ... Chris

Re: How to get Delete buffer from external DW

$
0
0

Hi Chris,

 

Actually, an external DW can be used to perform updates and has buffers just like any other. The column types in the DWO have to match up with the columns in a database table, and you have to manually specify the Update Properties.

 

Mariano,

To get info from the Delete! buffer, use GetItemNumber(), GetItemString(), or dot notation.

 

e.g.

ll_val = dw_external.GetItemNumber(1, "name", Delete!, FALSE)

or

ll_val = dw_external.object.name.delete.current[1]

Re: How to get Delete buffer from external DW

$
0
0

Hi Ronnie;

 

  Interesting ... The last time I tried accessing the Delete buffer in an External DW the command(s) failed. Although, I must admit that was many PB releases ago.

 

  I'll have to retry this in PB v12.6 and see exactly what happens. Hopefully, newer PB releases have addressed this deficiency. You have now peaked my interest in this area of the DW. 

 

Regards ... Chris

PS: we missed you last year at the PB Conference! 


Re: How to get Delete buffer from external DW

$
0
0

Thanks, Chris! I plan to be at this year's conference(s). Hopefully we'll soon find out when/where...

Re: How to get Delete buffer from external DW

$
0
0

OK .... here are the tests under PB 12.6 ...

 

Code in the COPY command button:

    dc_target.object.data.primary = dc_source.object.data.delete

 

1) Normal external DW with deleted rows ...  FAIL

 

2) External DW mapped to a dummy table - OK

 

3) External DW with Ronnie`s fake Update Table properties set  - OK

 

HTH

Regards ... Chris

Re: Getting Error while parsing the JSON string using ScriptControl

$
0
0

There's a free PB object for parsing JSON, SailJSON from http://www.pblsoft.com/sailjson.htm.

 

However, you will want to hack it a bit, because although it works well, it throws a SystemError, which you generally won't want, if you request an element from the JSON that doesn't exist! (Search for "signalrerror" in the object, replace it with something.)

Re: Can you point me to a Word website?

$
0
0

My inclination would be to think that if your code is putting in data from wrong records in your DB, the problem is in your PB code injecting the data, not in the specific Word aspects.

 

A current reference for the Word object model seems to be http://msdn.microsoft.com/en-us/library/ff837519.aspx.

Re: SMTP - of_sendmail

$
0
0

Can you try it with the same SMTP settings in an email client program on that computer and see whether it works? Although I don't use Roland's code (I use the ChilkatSoft DLL) I find that most problems are the wrong settings.

 

Having said that, using Gmail SMTP servers, if that comes up, is a real pain, because they require you to either "Allow Insecure Apps" or do some complex OAuth2 stuff (which I have actually implemented, and am willing to share) to authorize that specific application to send email through Gmail's server.

Re: PB Newbie - INI file

$
0
0

If one of the things you need to store in the INI file is a password for access to the DB, you should probably not store it as clear text, but encrypt it with a reversible encryption.

Re: PB SCC (SVN): issues and best practices

$
0
0

I can endorse Roland's WizSource, I use it and it's very satisfactory.


Re: I am getting error on calling external function Navigate(Other functions also) of Microsoft Web Browser using OLE in our application.

$
0
0

I don't have an answer about the WebBrowser specifically, but why not just stick with the 32-bit EXE? It works fine on 64-bit systems, and then you don't have to maintain two versions of your app.

Evaluating a DW column's ValidationMsg Correctly

$
0
0

In my application I replace the Messagebox with a custom HTML Messagebox object, so that it can have larger fonts and thus be more readable, use boldface for emphasis, etc. (It's my object, which I originally paid someone to develop in C++, then enhanced further myself. A slightly older version of it is available for free at www.html-messagebox.com - I plan to update it soon when I get some time.)

 

So one of the things I wanted to do with that is replace PB's validation messages, which show up in a messagebox with the title "Data Entry Error" (which I also don't like).

 

To do that, I have an inherited DW control, u_dw, with an ItemError event that evaluates the ValidationMsg for the row and column, then posts my Messagebox replacement showing it. However, since a ValidationMsg can include complex expressions (mine often do) it turned out it was really quite complicated to evaluate them properly and get the right message. Here is the code which I think I have finally settled on, which seems to work whether single or double quotes (or some combination) is used in the expression (which is what complicated things).

 

// Evaluate and return the validation message for the passed-in column name and row.

String validation, msg
Boolean lbRemovedQuotes

validation = Trim(this.Describe(asColName + ".ValidationMsg"))

// The following sometimes needed, because some expressions come in with double quotes added.
// But don't use gf_trim_quotes, which also trims single quotes, which we need to keep, e.g. for validation
//    messages that are just single quoted strings.
lbRemovedQuotes = gf_trim_double_quotes(validation)

// Escape tildes, single and double quotes in the message, things mess up otherwise!
// However, if we reomoved double quotes around the message, any double quotes within it will already be
//    escaped, sose need to first hide them, then put them back in.
if lbRemovedQuotes then
gf_replace_all(validation, '~~"', "XYZX")
end if
gf_replace_all(validation, "~~", "~~~~") // tildes
gf_replace_all(validation, "'", "~~'") // single quotes
gf_replace_all(validation, '"', '~~"') // double quotes
if lbRemovedQuotes then
gf_replace_all(validation, "XYZX", '~~"')
end if

// The validation string it might be an expression, have to evaluate it
msg = this.Describe("Evaluate('" + validation + "', " + String(llRow) + ")")

return msg

Note: my gf_trim_double_quotes function is to remove leading and trailing double quotes from strings; it returns TRUE if it did so, FALSE if no such change was needed because the string wasn't surrounded with double quotes.

 

I would welcome any comments on this code!

Re: I am getting error on calling external function Navigate(Other functions also) of Microsoft Web Browser using OLE in our application.

$
0
0

The simple answer is NO. Unless there is a very good technical reason why you MUST use 64bit, you should not use it. You are just going to open yourself up to these sorts of issues. You will also need the 64bit version of the database interface and any other apps you interact with (Word/Excel for example).

 

32bit applications work perfectly fine on 64bit versions of Windows.

Re: Evaluating a DW column's ValidationMsg Correctly

$
0
0

Have your treid a simplified validation like:

 

validation = Trim(this.Describe(asColName + ".ValidationMsg"))

msg = this.Describe("Evaluate(" + validation + ", " + String(llRow) + ")")


The only issue I see is that  gettext() is not always working fine ( on a checkbox).


hth


Arnd


Re: Evaluating a DW column's ValidationMsg Correctly

$
0
0

I have many validation expressions for which that does not work, Arnd. It may actually only work for simple single-quoted strings. That's why I had to make it so complex.

 

By the way, I added some code after getting the validation string via Describe, to take care of columns with no validation message at all, where it's just the basic data type validation that is firing:

if validation = "?" then
// There was no defined validation, just give a generic message based on the type.
colType = this.Describe(asColName + ".ColType")
if Left(colType, 3) = "dec" or colType = "real" then
return "Please enter a valid amount in this field, if you wish to enter a value in it."
elseif colType = "int" or colType = "long" or colType = "number" or colType = "ulong" then
return "Please enter a valid number in this field, if you wish to enter a value in it."
elseif colType = "date" then
return 'Please enter a valid date in your Short Date Format specified in Control Panel.'
else
return "Please enter a valid value for this field, if you wish to enter a value in it."
end if
end if

Viewing all 7329 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>