Im trying to add another data in a from table in a separate database to my script,
but I keep getting this error all time.
My script
connect database "chris.db" .
run chrisf.p
disconnect databse.
The error I'm getting
How can I get round this issue?
Thank you.
The word "database" is not part of the syntax for the CONNECT statement.
CONNECT "chris".
is the correct syntax.
The OpenEdge documentation for CONNECT is here: https://documentation.progress.com/output/OpenEdge117/openedge117/?_ga=2.93982683.75218856.1547464117-1040589272.1546786181#page/dvpin%2Fthe-connect-statement.html
I'm not sure what you are trying to do with:
run chrisf.p disconnect databse.
but that will run an external procedure called "chrisf.p" and pass 2 "compile on the fly" parameters with values of "disconnect" and "databse". (I'm pretty sure that's not really what you intend.)
Related
I'm using Access VBA to call an R script that builds some charts. This R script pulls some data from the Access database via an ODBC query. I'm using library(RODBC) to make the connection from R.
If I restart Access, or run Compact/Repair, the query will always run. However, if I make other changes in the database, I'll sometimes get the following warning:
Warning messages:
1: In odbcDriverConnect(sprintf("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=%s", :
[RODBC] ERROR: state HY000, code -3810, message [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.'
And the script fails to run, because the connection couldn't be made.
What's the best way to manage/set the state of the database so the query will always run? The issue isn't directly linked to whether a table is open or not - I can open a table, and close a table, and not have an issue, and even run with a table open, sometimes.
Edit: The error is caused by making any sort of change in a VBA module (this is unrelated to the actual VBA call of the script, I can run the same rscript call in the command line and replicate the error). Now that I understand that's the cause, I don't think it's a big issue. Saving the VBA module sometimes seems to correct the error, although not 100% of the time.
This is by design.
Making any design change to a VBA module, form or report sets an exclusive lock on an accdb file, which remains until the Access application that has made the change closes.
Just close and re-open the file after making any design change to a form, report or VBA module.
This is one of the reasons people recommend you split the database, since then you can change the design without locking people out of the data.
I have been trying to connect to Oracle DB (11g) in SSIS (VS2015) from past few days and tried all possible solutions but still getting error. I am passing query through SSIS variable, no other parameter is passed, it is just test query which need to retrieve two rows.
Case 1: Tried using Oracle Provider for OLEDB, test connection is successful but getting below error while Preview data:
The system cannot find message text for message number 0x80040e51 in the message file for OraOLEDB. (OraOLEDB)
Case 2: Tried using Microsoft OLEDB Provider for Oracle, test connection is successful but getting below error while Preview data:
Provider cannot derive parameter information and SetParameterInfo has not been called.
I have been struggling to solve this problem, any help would be appreciated. Thanks in Advance.
Edit: After setting Run64bitRuntime to false, I can extract data when using Oracle Provider for OLEDB, but Preview still gives same error.
Regards,
Jazz
Set Run64bitRuntime to false for the package and then it should work.
Right click Project and click Properties
In Configuration Properties at left side click Debugging
set Run64BitRunTime options as false
Some advice on this is all focused on "Preview". Don't throw the baby out with the bath water. With VS 2017 enterprise I got the "cannot find message text ... " message with Preview but was able to put oracle data into ms sql as a job (the gui has a problem, but not the run time job). I did set AlwaysUseDefaultCodePage to true on Component Properties in Advanced Editor on the OLEDB oracle task.
Hi Guys Im having trouble understanding how to get around this error
When trying to create a ODCB connection we cant get past the error Error 18470 Login failed for user ####. Reason : The account is disabled.
Of course we have tested that the login to the contained database works through SMSS.
But cant google find anything on how to do a ODBC connection string to work around the .
ODBC is needed for the application that is going to be setup to use the contained databases...
Any suggestions appreciated...
I fixed this because i remembered that often when you create the ODBC connection when setting up a sql account - you can fool the gui - put the details in of the account your trying to use - password - and then simply untick the use this account box – MoOriginal 1 min ago edit
Even though this greys out the box the details are still stored and allow you proceed to the next stages of setup so you can achieve connection by explicitly specifying the database in the next step - cut and paste - then you can go ahead and finally test the connection- this is what i did and this allowed me to create the connection. – MoOriginal just now edit
I am very new to AS400, and I am stuck. I have read documenation but cannot find what I need.
I have an odbc connection to an AS400 server. When I run this command I get an Outfile with everything I need:
CALL QSYS.QCMDEXC('DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(CHHFLE/TEST3)', 0000000061.00000)
Instead of the results going to an outfile I need to receive the results of this command to my script that is connecting through odbc. If I change 'OUTPUT(*OUTFILE)' to 'OUTPUT(*)' I get no results when I try to 'fetchall()'.
Is there any way to get this information through the odbc connection to my script?
EDIT: I am on a linux server, in a python script using pyodbc to connect. I can run sql queries successfully using this connection, but I can't figure out how to get the results of a command to come through as some sort of record set.
I hope I'm interpreting what you're asking correctly. it looks like you're accessing user profile data and dumping it to a file. It looks like you then want to use the contents of that file in a script or something that's running on Windows. If that's the case:
In general, when accessing data in a file from the Windows world, whether through ODBC and VBScript, or .NET, the AS/400 is treated like a database. All files in libraries are exposed via the built-in DB2 database. It's all automatic, and part of the Universal DB2 database.
So, after creating this file, you should have a file named TEST3 in library CHHFLE
You'd create a connection and execute the following SQL statement to read the contents:
Select * From CHHFLE.TEST3
This, of course, assumes that you have proper permissions to access this. You should be able to test this using the iSeries Navigator tool, which includes the ability to run SQL Scripts against the database before doing it in your script.
Added after reading comments above
There's info at this question on connecting to the DB2 from Python. I hope it's helpful.
OUTPUT(*) is not stdout, unfortunately. That means you won't be able to redirect OUTPUT(*) to an ODBC connection. Dumping to a DB2 table via OUTPUT(*OUTFILE) is a good plan. Once that's done, use a standard cursor / fetch loop as though you were working with any other DB2 table.
When I using the Table Adapters of a Data Set,I get the following an error in the screenshot as below.What might be the problem?
I think you need to check your query string to make sure that it is connecting to the database because the xsd is trying to make a connection to your database and the server replies with time out.