ms-access

How to create parameterized queries in vb.net?

点点圈 提交于 2020-01-28 11:27:27
问题 Using parameterized queries with ms access 2003 integration. To search any data according to different criteria. 回答1: You'll need to use the OleDbConnection class, as well as the OleDbCommand class, with the proper connection string for Access. Dim sql as String = "SELECT * FROM TABLE_A WHERE COLUMN_A = @PARAM" Dim connectionString as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;" Using connection As New OleDbConnection(connectionString) Dim

How to make SQL case sensitive

时光毁灭记忆、已成空白 提交于 2020-01-28 09:56:26
问题 I have an Access database set up on a domain hosting service. I am connecting to it through SQL. However, I need all of my queries to be case sensitive, and as far as I know the way the server is set up on the hosting service is it's NOT case sensitive. Is there a certain command that I could use in my SQL which would make the query case sensitive? 回答1: I think you can add collate after the WHERE clause. SELECT col FROM table WHERE col COLLATE Latin1_General_CS_AS = 'value' 回答2: Do you need

Query for getting value from another record in same table and filter by difference greater than a gap threshold

微笑、不失礼 提交于 2020-01-26 20:54:46
问题 I have data imported into a temporary table in MSAccess which looks like this: to which I have added the "Gap" and "Previous/Current" columns that I need to calculate using an SQL Query. The "Gap Threshold" is User input or PARAMETER supplied to Query and for e.g. is 300. The GlobalID groups ItemID's whereas each ItemID is unique number. What i want to do is calculate the GAP (GAP = TEMPORARY_1![VERSION DATE] - TEMPORARY![VERSION DATE]) between ItemID's of similar GlobalID's and identify the

Trying to execute a SQL statement from VBA to an Access database, getting a syntax error with the INSERT INTO statement [closed]

点点圈 提交于 2020-01-26 04:00:08
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . This is the code: sqlStr = "INSERT INTO Students (ID, Last Name, First Name, E-mail Address, Student ID, Level, Date of Birth, Home Phone, Address, City, State/Province) VALUES ('" & ID.Value & "','" & lastName.Value & "','" & firstName.Value & "','" & email.Value & "','" & studentID.Value & "','" &

How to convert the Partition function in Access for use in Microsoft SQL Server?

我怕爱的太早我们不能终老 提交于 2020-01-25 20:50:47
问题 I have used MS Access a lot, but I was recently asked to help with a SQL Server database. I noticed that simply copying the SQL code from Access over to the server database doesn't work. Could someone please help me replicate the functionality of my SQL code from Access into SQL Server? Below is the SQL View that works within Access: SELECT [LV1]-[LV2] AS Aging, Partition([Aging],1,100,10) AS AgingRange FROM Table1; Aging is a calculated column based off of two columns within my table. I want

Combobox query in Access 03 database showing on some pc's limited data

拈花ヽ惹草 提交于 2020-01-25 19:02:49
问题 I have a combobox which looks at a table and displays it's 5 columns of data via a query to be used like a search, on most pc's all 5 columns populate with data but on some only the last 3 columns populate and it displays blank FirstName and Surname columns, any idea how this could happen or how to fix it? Also the combobox isn't used to select just to confirm that searched for people are in the database so there are no events and it is all setup in the combobox properties. Edit- I bet a post

Having trouble using count() in Access SQL query

送分小仙女□ 提交于 2020-01-25 12:43:51
问题 Using Access 2007. I have a table Inventory with the following fields: ContainerID FolderID My goal is to find out which FolderIDs correspond to more than one ContainerID, and what the ContainerIDs are for these records. I thought the best way to handle this would be doing a query that returns ContainerID, FolderID, and a count of each FolderID, so that I could sort that list to put the records with count>1 on top. I tried this with: select ContainerID,FolderID,count(FolderID) from (select

Having trouble using count() in Access SQL query

ε祈祈猫儿з 提交于 2020-01-25 12:42:35
问题 Using Access 2007. I have a table Inventory with the following fields: ContainerID FolderID My goal is to find out which FolderIDs correspond to more than one ContainerID, and what the ContainerIDs are for these records. I thought the best way to handle this would be doing a query that returns ContainerID, FolderID, and a count of each FolderID, so that I could sort that list to put the records with count>1 on top. I tried this with: select ContainerID,FolderID,count(FolderID) from (select

Copying data from a MS Access form into Excel

泪湿孤枕 提交于 2020-01-25 09:19:06
问题 I have code that takes fields from a MS Access form and copies the data into a saved Excel file. The first record in Access in imported to Excel with a range of A2:I2. The second record in Access is imported to Excel with a range of A3:I3, and so on.... What currently happens now is if I close my form in Access and open it back up, and say I already had two records imported into this same Excel file, and now I want to add a third record, it will start over at the first row (A2:I2) and write

set Access database table field with form check box

ぐ巨炮叔叔 提交于 2020-01-25 08:51:05
问题 I am trying to set the value of a number field on a table using the value of a bound checkbox on a form. The value needs to be 40 if checked and 0 if unchecked. I'm new to this and have no idea where to start. No, the checkbox was added to a form and is bound to a number field in the table. The data is imported from an antiquated system that uses codes that most users would not understand, so if it says 40 in the table I just want the form to show checked, all other values should show