I create a button on click of that button a perticular location will open and I have to select the db file from that location.
Like we use to do in the data dictionary if we want to connect to the database we used to click on the browse button after that we select the db file from the location and the database will connect. I need to create a utiliy like data dictionary's connect db option. Is there any command for it?
Why not just use the DataDictionary?
Otherwise:
1. First you need to connect to the DB. Check the CONNECT method.
2. To look at tables and fields in the database you can used "Virtual System Tables".
Just a short snippet to get you started:
FOR EACH _file NO-LOCK:
IF _file._file-name BEGINS "_" THEN NEXT.
DISPLAY _file._file-name.
FOR EACH _field OF _file NO-LOCK :
DISPLAY _field._field-name.
END.
END.
Related
I have SQL Server 2008 R2 linked tables in my MS Access 2010.
I have many forms in this MS Access database. Few of my forms gets Write Conflict error when I try to assign it to a SQL statement as record source after I have updated very same record by SQL statement (or assign some values on form programmatically and refreshed the form in module) as I have general function being called every time I enter certain text on one of the field on form and it gets updated some of the forms fields value programmatically.
I have a TIMESTAMP column in my table in SQL Server.
So after updating the fields on the forms, when I try to assign a new record like
Me.Recordsouce = sqlstring , I get a "write conflict" error.
I tried to set on button click before I assign a recordsource
Refresh
Docmd.RunCommand AcCmdSaveRecord
But they all throw the same "Write Conflict" error and asking me to drop changes.
Please help
Many thanks,
I'm testing a project with two databases joined by a MANY-ONE relation (Devices -> Employees). Both datasources are Google Drive Tables. How can I delete all of the data in both of these tables, without deleting the tables themselves? I'd like to keep their metadata and relations intact but start with fresh data. Based on another answer, I've tried to run the following commands on button press:
var records = app.models.Device.newQuery().run();
app.deleteRecords(records);
var records = app.models.Employee.newQuery().run();
app.deleteRecords(records);
But I receive the error:
app.models.Device.newQuery is not a function
at AddDevice.Button1.onClick:1:33
And I wasn't sure where to go from there. Thanks in advance.
First of all, you should run this code on server side:
// server script
function deleteAll() {
var records = app.models.Employee.newQuery().run();
app.deleteRecords(records);
...
}
// Client script, for instance button's onClick event handler
google.script.run.deleteAll();
Then you can simplify your life, by specifying relation Owner. If you have it configured, then when you delete master record all related records will be deleted(cascade deletion). If you properly setup relations for all your models, then you'll need to delete records only from one model/table and all other records will be delete as well:
PS
As a quick and simple workaround, you can simply create a brand-new deployment(out of the box all models/tables will be empty).
I'm using Dexi.io to scrape some data that outputs to Google Drive as a CSV, that gets parsed (through a Google sheets script) and added to a Native sheet (all automatically).
I'd like to push my data (automatically) to a "database Visualizer" of some sort (using knack.com currently) that allows me to display the data (in Table format) with some options to filter, sort and dig deeper; all protected by login creds that I manage.
I tried using Zapier to automate the Google Sheets to Knack integration, but Knack only has an option to "Create New Records" through Zapier and not "Update Records". (Updating records exists as an API endpoint)
I need help proceeding as I'm not a developer and am starting to hit the limits of my capabilities.
Could someone please recommend a tool (that integrates with Sheets, updates data periodically and lets me control the domain and login creds) or the optimal way to proceed with this? (I'd gladly hire a freelancer to help me build this out optimally)
Some more, potentially relevant, info: Dexi.io can output through FTP, Drive, Box or Amazon S3 (remember, not a dev :$)
kintone is a "database Visualizer" similar to Knack, and they have actions to update records.
https://zapier.com/zapbook/kintone/
There are two options to update records as there are two ways in which the unique key can be defined.
Each record in kintone has a "Record ID" associated with it - this is an autonumber made by kintone. You can specify this as the key to update, in which case you would use the "Update Record By Record ID" action.
If you would prefer though to set your own unique key and use that as the key to update, you can define that unique key in your database (I guess the data you are scraping has its own ID for each record). In this case, you can place a "Text (single-line)" field in your database, open up the options and select "Prohibit duplicate values" which will make this field into a unique field - meaning that no two records can hold the same value.
Once you set that field up (and update your kintone App settings), you can select this field to be the unique key to update for the "Update Record By Update Key" Action (the "Update Key" in the action name is referring to the unique key that you just made).
And yes, kintone gives you control over login creds, and each login cred can have different view/add/edit permissions over each record you have in your app.
You can also set a custom subdomain name, but the domain name will have to be kintone.com i.e. you can have a https:/ /mycustomname.kintone.com sort of name.
Hope this helps.
In my access database there is a dataset which I need to know how it has been created. I tried to backtrack and reached to a table for which I am not able to find any source data. I am pretty much sure that it has been imported from some where. I checked in "View" option there is not "SQL" view for that table. It only has "Datasheet" view and "Design View".
In access database is there any way to check that whether a file has been imported or has been created using SQL query within access database? Is there any "flag" raised or something like that?
No. Once data is persisted in a table, that's it.
If you need further info, you can have a Timestamp field with a default value of:
Now()
or, if a higher resolution than one second is needed:
Date() + Timer() / 86400
or another custom field where you record session info as you like during the import or creation of data.
I was given a report today with a normal embedded data set (dataset1) and data source (datasource1) but the data set query is just a number: '1411'. The previous programer manually entered fields (not calculated fields) into the field tab.
When I click RUN, it works.
How is it populating the page without a proper query?
-There is only 1 tablix called (table1.) It also is pointing to dataset1.
-In Report Properties there is no VB code.
-RDL XML: Under dataset1's tag:
<DataSourceName>datasource1</DataSourceName>
<CommandText>=1411</CommandText>
I see no other SQL listed. Could there be something else on the server that's triggering it?
What sort of data source is "datasource1"?
If it's an RDBMS, check if there is a stored procedure or function in the database with the name "1411".
In SQL Server for example you could conceivably have a stored procedure called [1411] that returned a data set.
I'm assuming we are talking RDL (Report Definition Language). You might open this report with your favorite text editor and look at the CommandText XML tag to find the associated query. Hope that helps.