ms-access-2007

Migration Access to SQL server 2012

北战南征 提交于 2019-11-29 17:00:00
For an project, I need to migrate an Access database to SQL server 2012 express, I found some ways to do this, like using Microsoft up-sizing, but this question is not very technical but just to find out alternative ways, the database in access contains confidential data, so im not allowed to see data and I want to find out is there is any procedure that can be useful for me to achieve migration with out seeing the database itself and how to verify the data is exact in both. I don't have database background so specific directions and resources is useful. I don't know how to search for specific

Attempting CREATE VIEW in Access gives “Syntax error in CREATE TABLE statement”

一曲冷凌霜 提交于 2019-11-29 15:10:24
I typed this code to create a view in a pre created database: CREATE VIEW NHTrips AS SELECT TripID, TripName, StartLocation, State, Distance, MaxGrpSize, Type, Season FROM Trip WHERE State = 'NH' ; When I try to run Access(2007) responds with a an error message: "Syntax error in CREATE TABLE statement." Why? Access supports CREATE VIEW when you execute it from ADO/OleDb. This code snippet works because CurrentProject.Connection is an ADO object ... Dim strSql As String strSql = "CREATE VIEW NHTrips AS" & vbCrLf & _ "SELECT TripID, TripName, StartLocation, State, Distance, MaxGrpSize, Type,

How to call VBA-function for specifying columns in SQL TRANSFORM query?

一个人想着一个人 提交于 2019-11-29 14:42:14
Here is my query: PARAMETERS ... TRANSFORM ... SELECT ... ... PIVOT Mytable.type In ("Other","Info"); This is a cross query and I need to set all the column headings with this row: PIVOT Mytable.type In ("Other","Info") and now I have hard-coded the headings, Other and Info . But I want to do this dynamically. So what I want to do is to call a vba-function that returns all the headings I need. Something like this: PIVOT Mytable.type In (myVbaFunction()); So my question is: How to call a vba-function inside the sql-query? Christian Specht Yes, it is possible. However, I don't think it's

MS Access Contains query

自闭症网瘾萝莉.ら 提交于 2019-11-29 14:33:00
How to write contain query for msaccess database My table have column value ' CHOPE PARMA TERA 101' my search keyword in PARMA . How can I write contain query to retrieve the record ? Tony Hopkinson Query in MS Access: select * from SomeTable Where SomeColumn Like '* PARMA *' For standard SQL, it would be like '% PARMA %' Note that the above statement would not find 'PARMA', 'CHOPE PARMA', or CHOPE PARMAHAM 101', or any value with that contains PARMA; to do so just remove the spaces in the search string, e.g. '*PARMA*' select * from SomeTable Where SomeColumn Like '*PARMA*' Are you asking

Passing Query Parameter to Sub-Report

六月ゝ 毕业季﹏ 提交于 2019-11-29 14:26:31
It has been a long time since I have worked with MS Access and am not sure if I am doing this right. I have a Report bound to a query of single list of user names. The report groups on the user name and has a sub-report in the detail that is a chart. The sub-report/chart is based on a query that accepts a parameter of the user name. Since the sub report is not bound I need to pass the user name parameter from the main report detail onload event down to the sub-report and thus into the underlying query. I am not understanding how to make that happen or even if my approach is sound. (p.s. i

email using Access and VBA without MAPI

走远了吗. 提交于 2019-11-29 14:21:24
I would like to send email from Microsoft Access unattended using VBA. I understand that the built-in method “SendObject” uses MAPI meaning security prompts and something like Outlook configured. Since I want to use the Task Scheduler to kick off different reports, I’m leaning away from MAPI and would prefer some other solution. Not an application for shipping but just in-house. Ideas? You'll need an SMTP server that will allow you to send email. Then you need to use the CDO message object. Knox Here's the test code that worked for me with CDO and gmail. Sub mtest() Dim cdoConfig Dim msgOne

“Save as…” dialog box in MSAccess vba: how?

大兔子大兔子 提交于 2019-11-29 13:01:40
In MSAccess I've a mask with a button. When the user clicks on the button, the data in a table are exported on a .txt file: Private Sub Command_Click() Dim Rst As DAO.Recordset Dim AField As DAO.Field Dim TempStr As String Dim FileNumber FileNumber = FreeFile Open "c:\table.txt" For Output As #FileNumber Set Rst = CurrentDb.OpenRecordset("Tabella1", dbOpenForwardOnly) Do While Not Rst.EOF For Each AField In Rst.Fields If (AField.Name <> "ID") Then TempStr = TempStr & AField.value & " " End If Next Print #FileNumber, Left(TempStr, Len(TempStr) - 1) TempStr = "" Rst.MoveNext Loop Rst.Close Set

Connection string for Access to call SQL Server stored procedure

≯℡__Kan透↙ 提交于 2019-11-29 12:50:26
Using Access 2007, I want to call a stored procedure with one input parameter that returns a recordset. Using ADODB, this is pretty straightforward except for the connection string. I want to be able to derive the server and database names from a particular table, which always points to the correct server and database. (I reconnect to development dbs from time to time for testing by relinking the 100 or so linked tables.) Is there a way to get the server and database name from the tabledef without parsing the whole thing out? Is there a property? I haven't found one yet.... Final query is

Ensure SQL-92 on Access 2000 mdb to SQL Server under Access 2010

為{幸葍}努か 提交于 2019-11-29 11:55:15
Due to circumstances not fully under my control, I have to develop ACCESS queries which will be stored in an Access 2000 MDB but which may be developed under any one of: Access 2000, 2002, 2003, 2007, 2010. These queries will access (via linked tables) either an MS SQL Server DB or an Access 2000 .MDB file. In the past, we had issues which we tracked down to queries not being ANSI-92 compatible. This we solved by marking the Check Box in the Tables/Queries tab of the Tools|Options dialog (under older versions of Access than 2007). We move these Access application .MDBs between various systems

Importing a text with separators using VBA

孤者浪人 提交于 2019-11-29 10:35:06
I am trying to automate the adding of new text files, which all have the same (known) layout. The columns are separated using tabs (the TAB button). My question is, is it possible to do this in VBA? Like, in the access wizard for importing text files? I am using the DoCmd.TransferText method in VBA You'll need to go through the wizard once to make your specification file. TO do this import your text file like normal but before you get too deep into the wizard click on the bottom left, the "Advanced..." button. This is where you make your spec file. Make ll these columns match your input file,