ms-access

Sequential Column Where Conditional - SQL / Access

六月ゝ 毕业季﹏ 提交于 2019-12-24 10:56:15
问题 Suppose we have some data that looks like so R_Id Nm Base Dest Proj Cust_id 201203 201202 201201 MRBR Bob LONDON UK Project1 1 0 0 0 MRBU Frank LONDON London Project2 2 11.68 0 248.93 MRBU Frank LONDON UK Project3 1 7.4 4.8 0 MRGB Barry GUILDFORD Hull Project4 1 50.36 12.85 48.92 MRGB Barry GUILDFORD Project5 1 0 177.31 0 MRGB Barry GUILDFORD INTL Project6 3 0 331.08 0 And suppose we have a lot more columns than above, but we've limited to a few for now. I want to be able to use a where

C# How to save image from an OLE Object stored in a Database

半城伤御伤魂 提交于 2019-12-24 10:52:59
问题 It seems that header bytes are stored along with an image when it is embedded into an access database as a OLE Object and they are preventing me from writing the bytes stored to disc as it raises an exception 'A generic error occurred in GDI+.' How do you extract only the image bytes from a OLE Object stored in an access database and then save to disk? photo = ((rs.Fields["photo"].Value == System.DBNull.Value) ? null : (byte[])rs.Fields["photo"].Value) ... if (photo != null) { MemoryStream

delete table if exists in Microsoft Access

久未见 提交于 2019-12-24 10:51:12
问题 I have one application in which I need to delete table if exit in Microsoft Access Database. I saw the code here. The table name which I want to delete is data_table and the access database file name is local_entry so where I need to change the code so it work for my application. public void testDropTable () throws SQLException{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:MsAccessDSN"); Statement stmt = con.createStatement();

horizontalAlignment doesn't work with xlFill

纵然是瞬间 提交于 2019-12-24 10:47:39
问题 I am trying to make my column in excel fit into the column size that I give it, I am trying to use the property horizontalAlignment to do this. I can get it working with xlCenter, but I need to do xlFill but there isn't a value for xlFill. With objExcelAssist.worksheet.columns("N:N") .horizontalAlignment = xlCenter End With What I have tried: With objExcelAssist.worksheet.columns("N:N") .horizontalAlignment = xlFill End With With objExcelAssist.worksheet.columns("N:N") .horizontalAlignment =

character encoding puzzle with PHP/MS Access

蹲街弑〆低调 提交于 2019-12-24 10:46:08
问题 NB This is MS Access 2000, and this PHP file is called with an ajax call... At the start of this PHP file I have put ini_set('default_charset', 'utf-8'); The $token below comes from these lines $search_string = $_GET[ 'search_string' ]; $search_tokens = explode( " ", $search_string ); $token = $search_tokens[ 0 ]; This works OK when I have a "token" without French accented characters: $sql="SELECT * FROM tblFrEng WHERE French = '$token'"; echo "=== SQL is $sql<br>"; $sth = $dbh->prepare( $sql

Unable to remove master -> child subform links in microsoft access 2003

走远了吗. 提交于 2019-12-24 10:45:33
问题 I am having an issue removing the master -> child link fields in an access subreport data form. I have tried every avenue to remove them, using the properties window of the subreport as well as the link wizard. I have also deleted the subreport from the database and then gone as far as re-importing the existing objects into a new access instance. As soon as I re-added the subform back in and name it the same name the link fields show back up. Something is apparently corrupt, but I have run

Compile Error: Expected function or variable in VBA for access

ぐ巨炮叔叔 提交于 2019-12-24 10:44:10
问题 I know near nothing about VBA, but I'm trying to modify an application to connect to a MySQL Database. The following code produces a Compile error at rstProjets.Open and I can't seem to find why. Public mysqlConn As ADODB.Connection Private Sub cmdUpdate_Click() Dim rstProjets As ADODB.Recordset ConnectMySQL Set rstProjets = rstProjets.Open("SELECT * FROM subventions LIMIT 5", mysqlConn) With rstProjets If Not .EOF And Not .BOF Then .MoveFirst Do While Not .EOF MsgBox "Subventions:" &

Find users logged into Access database using Powershell

帅比萌擦擦* 提交于 2019-12-24 10:42:00
问题 I have a multi-user Access database which is compacted daily using a powershell script. This script can't compact the database if there are still users logged in. If there is a user logged in, I would like be able to idenify the user(s) who forgot to logout of the database and remind them to log out at the end of the day. If I were to write this in VB it would work like this: Dim cn as ADODB.Connection Dim rs as ADODB.Recordset cn.open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=...mdb")

Inserting not committed to database

非 Y 不嫁゛ 提交于 2019-12-24 10:39:41
问题 I'm having some trouble getting my DataSet to work. I have a MDB-Database in the background and created a DataSet out of it. Now I created a new method that lets me create a new user in the table. But when I call it, nothing happens. No exceptions, no errors and I even get "1" returned as number of affected rows. But when I look in the database, no user was added. I have the feeling that I miss to somehow tell the DataSet that I want to operate the Database itself rather than just the

SQL Statement to Remove Duplicates and get Counts

允我心安 提交于 2019-12-24 10:27:02
问题 My continuing SQL headache... If I run this paraphrased code: SELECT State, Name, ID FROM ... WHERE Lost=False I will get something like the following back: State Name ID NY A 123 NY A 123 NY B 234 NY C 345 MD X 356 MD Y 668 What I really need is a sum of the number of resources in each state. The problem here is that If I just do something like the following, it won't take into account that there are clearly duplicates (see the first two records above). SELECT state, Count(state) AS