I have a table inside that table 3 Columns {USERNAME,PASSWORD,IP}
I want to use that data to remote anyPC inside my network instead open the remote desktop and enter the user,pass and ip .
I used that code but that makes me open the remote desktop for an IP , but the user and password doesn't insert well.
That is my VB code
Private Sub Toggle133_Click()
Shell ("cmdkey /generic:TERMSRV" + ip.Value() + "/user:fourtex\" + Text126.Value() + "/pass:" + Text109.Value() & "mstsc.exe /v " + ip.Value())
Shell ("mstsc.exe /v " + ip.Value())
End Sub
Related
I have some script for my Google Sheet that returns a message prompt to the user when an action is completed...
Browser.msgBox('Inspection has been ADDED',
'Grower: ' + strIEGrower + '\\n' +
'Farm: ' + strIEFarm + '\\n' +
'Block: ' + strIEBlockNumber + '\\n' +
'Crop: ' + strIECropType,Browser.Buttons.OK);
It works fine when using the sheet on a desktop. But when I use it on a Mobile device the prompt does not show the prompt and my script errors with a timeout. I have tried using the...
SpreadsheetApp.getUi().alert('Complete');
It does not display either. Any help to display a message pop-up on a Mobile device would be appreciated.
I'm using the OpenShift Java REST Client (https://github.com/openshift/openshift-restclient-java), and I'm using some of the below code to try and do it:
IClient client = new ClientBuilder(osUrl)
.withUserName(userName)
.withPassword(mySecretPw)
.build();
System.out.println("=====API & Status==================================================================");
System.out.println(client.getOpenShiftAPIVersion() + ", " + client.getServerReadyStatus());
IPersistentVolume volume = (IPersistentVolume)client.getResourceFactory().stub(ResourceKind.PERSISTENT_VOLUME, "DEFAULT");
System.out.println("=====Version Etc:==================================================================");
System.out.println("Openshift API version : " + volume.getApiVersion() +", Volume name : " + volume.getName());
But this is just showing information from a single volume. When I use the OC command line, via:
oc get pv
I get around 20 volumes. How can I get a list of all the volumes in my OpenShift?
IClient client = new ClientBuilder(osUrl).withUserName(userName).withPassword(mySecretPw).build();
List<IPersistentVolume> persistentVolumes = client.list(ResourceKind.PERSISTENT_VOLUME);
I have downloaded and installed MySQL Connector 5.1 x64 so I can use MySQL with Delphi. I can make connection with ODBC and do a connection from my Delphi environment and from MySQL Workbench.
But, when I build my Query at runtime, I get an error saying:
Project AAA.exe raised exception class EOleException with message 'Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another'. Process stopped. Use Step or Run to continue.
My code:
qDates := TADOQuery.Create(Component);
qDates.Connection := FConnection;
qDates.SQL.Text :=
'select ' +
' * ' +
'from ' +
' resulttable ' +
'where ' +
' oid = :oid ' +
' and datedial >= :datebegin and datedial <= :dateend'; // <<-- Exception here
Details:
The exception happens right on the text assignment, before I have a chance to configure parameters.
If I comment out the where clause the assignment goes fine.
This is similar to Using parameters with ADO Query (mysql/MyConnector) but the difference is that I assign whole text at once and I get the exception before I have a chance to configure parameters.
The puzzling part - exact same code works fine on my other machine, but I can not figure out what is different.
Hence the question - what could cause the above exception outside of the Delphi code and MySQL server?
This seems to be a quirk with the MySQL ODBC provider.
If you assign the connection after setting the SQL text, then it will work.
The reason why can be found here.
qDates := TADOQuery.Create(Component);
// do net yet assign TADOConnection to prevent roundtrip to ODBC provider
qDates.SQL.Text :=
'select ' +
' * ' +
'from ' +
' resulttable ' +
'where ' +
' oid = :oid ' +
' and datedial >= :datebegin and datedial <= :dateend';
qDates.Connection := FConnection;
UPDATE
This QC entry explains the exact reason for this problem.
In short, the ADODB unit, patch this line from the RefreshFromOleDB procedure :
Parameter.Attributes := dwFlags and $FFFFFFF0; { Mask out Input/Output flags }
To:
if dwFlags and $FFFFFFF0 <= adParamSigned + adParamNullable + adParamLong then
Parameter.Attributes := dwFlags and $FFFFFFF0; { Mask out Input/Output flags }
I paste a >2KB SQL file to mysql CLI and it randomly loses characters and then reports syntax error in my SQL.
For example:
(.....)
UPDATE ct_transform_target_summary
SET
ytd_margin_target = jul_margin_target + aug_margin_target + sep_margin_target + oct_margin_target + nov_margin_target + dec_margin_target +
jan_margin_target + feb_margin_target + mar_margin_target + apr_margin_target + may_margin_target + jun_margin_target,
ytd_adjustments = jul_margin_adj + aug_margin_adj + sep_margin_adj + oct_margin_adj + nov_margin_adj + dec_margin_adj +
jan_margin_adj + feb_margin_adj + mar_margin_adj + apt_margin_adj + may_margin_adj + jun_margin_adj,
ytd_margin = jul_margin + aug_margin + sep_margin + oct_margin + nov_margin + dec_margin +
jan_margin + feb_margin + mar_margin + apr_margin + may_margin + jun_margin;
(....)
Becomes:
(....)
->
->
-> SET
-> ytd_margin_target = jul_margin_target + aug_margin_target + sep_margin_target + oct_margin_target + nov_margin_target + dec_margin_target +
->
-> ytd_adjustments = jul_margin_adj + aug_margin_adj + sep_margin_adj + oct_margin_adj + nov_margin_adj + dec_margin_adj +
-> jan_margin_adj + feb_ma
-> ytd_margin = jul_margin + aug_margin + sep_margin + oct_margin + nov_margin + dec_margin +
-> jan_margin + feb_margin + mar_margin + apr_margin + may_
This apparently never happens to short SQL code, but only happens to long code.
Could this be caused by my terminal (Fedora 17 Gnome terminal) or could it be an issue of mysql CLI?
Never had I experienced such problem in terminal before. It only happens in mysql cli.
Write the SQL to a file, ie: query.sql, then use the source command in the mySQL CLI.
$ vi query.sql
$ mysql -h db.host.tld -u user -p
mysql> use mydatabase
mysql> source query.sql
Pasting into the MySQL CLI client is tricky, because it uses Readline for interactive line editing. Readline interprets certain input as control sequences and does not pass them verbatim to the MySQL client. The character most likely to be causing problems in your case is tabulation, used often for indentation purposes in SQL, but used in Readline for tab completion. Inadvertent tab completion in the middle of your query might have very unexpected results and it is often hard to pinpoint the exact location where it has introduced interference.
I think Sammitch is on the right track here, but I believe that solution only works if you are logged into the machine where mysql is living. The following should work from anywhere.
$ vi query.sql
$ mysql -h db.host.tld -u user -p mydatabase < query.sql
Pasting into the CLI always makes me nervous!
Does this happen when you paste to a file in your terminal on your mysql server? Most likely you are having a buffer issue when pasting across the network. But I would check pasting to a file on the same server and if that works, then it is the mysql cli that is causing some issue, but I bet it's just the network latency causing problems.
I am attempting to connect to an Access 2000 database file (*.mdb), but I am having just a tad few issues. Here is the screenplay thus far,
1) Googled how to connect to a database using powershell which resulted in the following as a source code baseline.
$adOpenStatic = 3
$adLockOptimistic = 3
$objConnection = New-Object -comobject ADODB.Connection
$objRecordset = New-Object -comobject ADODB.Recordset
$objConnection.Open("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c:\scripts\sample.mdb")
$objRecordset.Open("Select * from TotalSales", $objConnection,$adOpenStatic,$adLockOptimistic)
$objRecordset.MoveFirst()
do
{ $objRecordset.Fields.Item("EmployeeName").Value; $objRecordset.MoveNext() }
until ($objRecordset.EOF -eq $True)
$objRecordset.Close()
$objConnection.Close()
2) I substituted the Data Source for the fully qualified path of my database then was presented with the following.
Exception calling "Open" with "5" argument(s): "Record(s) cannot be read; no read permission on 'RqRequirements'."
At :line:23 char:18
+ $objRecordset.Open <<<< ("Select * from RqRequirements", $objConnectionCsdscDB,$adOpenStatic,$adLockOptimistic)
3) Since this is a Rational RequisitePro database I almost never need to edit the database directly, but come to find out if we need to edit the database direct we need to issue the following command as a link on the Windows Desktop:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /wrkgrp C:\Program Files\Rational\RequisitePro\bin\rqprodb.mda" /user "xxxxxxx" /pwd "yyyyy"
4) Taking the script listed above and changing it slightly I have the following:
$adOpenStatic = 3
$adLockOptimistic = 3
$objConnectionRqProDB = New-Object -comobject ADODB.Connection
$objConnectionCsdscDB = New-Object -comobject ADODB.Connection
$objRecordset = New-Object -comobject ADODB.Recordset
$cnnStringRqProDB = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = C:\\Program Files\\Rational\\RequisitePro\\bin\\rqprodb.mda;" +
"UID=requisite admin;" +
"PWD=multiuser"
$cnnStringCsdscDB = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = J:\\TestPowerShell\\Rational.MDB"
$objConnectionRqProDB.Connectionstring = $cnnStringRqProDB
$objConnectionRqProDB.Open()
$objConnectionCsdscDB.Connectionstring = $cnnStringCsdscDB
$objConnectionCsdscDB.Open()
$objRecordset.Open("Select * from RqRequirements", $objConnectionCsdscDB,$adOpenStatic,$adLockOptimistic)
$objRecordset.Close()
$objConnection.Close()
5) When I run this script I get the following error:
Exception calling "Open" with "4" argument(s): "Could not find installable ISAM."
At :line:17 char:26
+ $objConnectionRqProDB.Open <<<< ()
6) I did some searching and found the following link, http://support.microsoft.com/kb/209805, and I checked the registry and the entry is present for
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Paradox
win32=C:\WINDOWS\system32\mspbde40.dll
this file is located in %SYSTEM32%\
Note, I do not have Access installed on my system (could this be an underlying problem? I am not sure, but I wouldn't think so since I am using the ADO)
Questions:
1) How do I include the "/wrkgrp" option in the connection string in the script?
2) Assuming the lack of the "/wrkgrp" option in the connection string is not my problem what might be issue?
3) Does Access need to be installed on the system in order for this to work?
Thanks, Mark
You shouldn't need Access installed.
You are trying to open the workgroup database (mdw) separately - don't do that.
You need to specify the workgroup database in the connect string
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;
Jet OLEDB:System Database=system.mdw;User ID=myUsername;Password=myPassword;
So in your case, use the following:
$cnnStringRqProDB = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = J:\\TestPowerShell\\Rational.MDB;" +
"Jet OLEDB:System Database = C:\\Program Files\\Rational\\RequisitePro\\bin\\rqprodb.mda;" +
"User ID=requisite admin;" +
"Password=multiuser"
$objConnectionCsdscDB.Connectionstring = $cnnStringCsdscDB
$objConnectionCsdscDB.Open()