Passing Value From A Access Form To A Query

Jun 23, 2006

Frustration has gotten the best of me on this one. Can anyone help?
I need to pass the current value in an Access Data Project (back-end is MS SQL) text field to the where condition in an SQL using VBA. This is what I have, but does not work.

Private Sub Command44_Click()
Me.SS.SetFocus
Dim strSQL As String
Dim strSSecurity As String
strSSecurity = Me.SS
strSQL = "Update Employees Set employees.PositionID = '',employees.jobcode = '' Where employees.ss = strSSecurity"
DoCmd.RunSQL strSQL
End Sub

It is supposed to take the current Social Security number from the form and match it against the employees table. Once it finds the matching record it should update the PositionID and JobCode fields to '' (empty string)
But it doesn't
Anyone with any ideas?
Thanks
Dan

View 2 Replies


ADVERTISEMENT

Passing Date Fields From Form To Access ADP Views

Jul 20, 2005

I have a whole bunch of forms that have an unbound StartDate and anEndDate field that I have used in MSAccess MDB databases as parametersin queries (ie tblEvent.StartDate > Forms!myFormName.StartDate.)So, now I'm migrating this beast over to and ADP/SQL Server projectusing Views and Procedures.How do I pass the value in Forms!myFormName.StartDate to a Procedureand get something that looks like:If tblEvent.StartDate > Forms!myFormName.StartDate then ...Any help is GREATLY appreciated. This is a major problem before I canmove ahead with this beast!lq

View 1 Replies View Related

MS Access Front End To SQL Server Problem Passing Form Value To Report

Jul 23, 2005

I just changed my Access 2002 database to a SQL Server ADP project. Ihad a form where the user entered a value into a text box and when acommand button on the form was clicked a Report was opened. The reportsrecord source is a query. The query uses the value from the form textbox to restrict the query.Table name = EggsTableone of the columns in the table is named: EggColorForm name = EggColorFormForm text box name = ColorTextBoxThis sql worked for the query before I converted to SQL:SELECT EggsTable.EggColorFROM EggsTableWHERE (((EggsTable.EggColor)=[Forms]![EggColorForm]![ColorTextBox]));This no longer works. Can I change the syntax somehow to get this towork? I tried dropping the brackets around the word "Forms", I trieddropping all the square brackets, etc., nothing worked.I also tried just opening the report with the report's Server Filterproperty set to:EggColor=N'Forms.EggColorForm.ColorTextBox'I tried using the Report's open event to pass the form value directlyto the report. I tried setting a variable from the text box value onthe form. So far, nothing works. Any ideas?

View 7 Replies View Related

How To Make The SSMSE To Return Whole Records Without Any Close Query Form And Re-create Query Form Operation?

Dec 25, 2007

Hi,
I got a problem.
I installed Microsoft SQL Server Management Studio Express 2005 version.
And I created a Compact database.
I created an connection in SSMSE to connect the database and opened a query form.
then, i run the following sql:

Select * from Table1

It returned 3 records to me.
After that, I used program to insert record into this table.
Then i ran this sql again, it still show me 3 records.
I closed the query form, and re-created a new query form, then run the sql, it returned 4 records to me.

Why? It's very strange and difficult to operate, right?
Is there anyone know how to make the SSMSE to return whole records without any close query form and re-create query form operation?

Thanks a lot!

And Merry X'max!!!

View 4 Replies View Related

Urgent: Passing Parameters From Vb To Access Query

Jan 12, 2004

hi all,

I have a view (query) created in ms acess. how can i pass a parameter from vb to the query at runtime? can i do it?

View 7 Replies View Related

Passing Parameter Query From SQL Function To Access Project Report

May 20, 2006

I can pass a parameter from an Access Query to an Access Report (MDB) by entering [Select Date] in the Query criteria and by placing an unbound control with a control source =[Select Date] on the report. I can't get this to work from a SQL Function Criteria to an unbound control on the Access Data Project Report. In the Function Criteria, I enter @SelectDate. In the Report control, I enter @SelectDate and it gives me an 'Invalide Column Name' error. Any idea how I can pass a parameter from a SQL Function to an ADP report?

THANKS!

p.s. I tried searching for other postings on this without any luck.

View 1 Replies View Related

Passing A Parameter From A Form To An Sql Sequel View

Oct 23, 2006

Hi, We have recently upsized an access db to a sequel server db. The queries in access have been made into views in sql. ASP will be the front end. We are having problems passing an input from a form into a view. In access the parameter had to match what was selected on the form but sequel doesn't like it. At the moment, for testing purposes, the value has to be hard coded i.e. case_id = 64. Is there anything is ASP that can help? Thank you

View 1 Replies View Related

Form Passing NULL To Database Instead Of Variable

Apr 12, 2007

Not sure what i'm doing wrong here. it seems to be sending nulls or no value to database in places where i want it to send the @headline and @entryhere's the .aspx code: <%@ Page Language="c#"     MasterPageFile="~/MasterPage.master"     AutoEventWireup="true"     CodeFile="NewPost.aspx.cs"     Inherits="NewPost"     Title="Scribbler Insert" %>       <asp:Content ID="PageBody" runat="server"    ContentPlaceHolderID="PageBody" ><table border="0" width="700" >  <tr>    <td width="80" valign="top">      Subject:    </td>    <td width="620" valign="top">      <asp:TextBox ID="txtHeadline" runat="server"           Width="400px"/>      <asp:RequiredFieldValidator runat="server"        ID="RequiredFieldValidator1"        ControlToValidate="txtHeadline"        ErrorMessage="Headline is required"         Display="Dynamic" />    </td>  </tr>  <tr>    <td width="80" valign="top">      Text:    </td>    <td width="620" valign="top">      <asp:TextBox ID="txtEntryText" runat="server"           TextMode="MultiLine"          Height="250px"          Width="400px" />      <asp:RequiredFieldValidator runat="server"        ID="RequiredFieldValidator2"        ControlToValidate="txtEntryText"        ErrorMessage="Text is required"         Display="Dynamic" />    </td>  </tr></table><asp:Button ID="btnPost" runat="server"     Text="Post" OnClick="btnPost_Click" /><asp:Button ID="btnCancel" runat="server"     PostBackUrl="~/Admin/Admin.aspx"     Text="Cancel" />   <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:scribblerdbConnectionString %>"            ProviderName="<%$ ConnectionStrings:scribblerdbConnectionString.ProviderName %>"    InsertCommand="INSERT INTO entries_tbl (Headline, entry, PostedBy, PostedDate, PostedTime) VALUES (@Headline, @Entry, 'SteveP', '2007-12-12', '12:44');" >         <InsertParameters>            <asp:ControlParameter Name="Headline"                ControlID="txtHeadline"                PropertyName="Text"                Type="String" />            <asp:ControlParameter Name="entry"                ControlID="txtEntryText"                PropertyName="Text"                Type="String" />             </InsertParameters></asp:SqlDataSource></asp:Content> 

View 2 Replies View Related

SQL ACCESS Vias Web Form

Dec 12, 2004

Hello, I'm having a problem connection to an Eval version of SQL Server 2000. I'm pretty sure the problem is not due to Eval version since...well, I need to evaluate the server if I intended to purchase it right? anyhow. I've loaded a copy of SQL server 2000 on my local machine. I only have one machine which I use for development and housing SQL Server.

I tried to set SQL up real "vanilla" and elected to use only Windows Authentication, this bypassing any userdefined passwords for the sa login.

Now...I've written a real basic Stored Procedure to test the connection and verify proper data transfer from the .aspx page. here's the SP SQL code and the .vb code behind page as well as the error I get. Note. I also tried Query Analyzer and was getting an error there as well indicating the SP could not be found...hmmm..

stored procedure:

CREATE PROCEDURE [dbo].[NewMemberInsert]

@UserNamevarchar(100),
@UserPassvarchar(10)

AS

INSERT INTO EEMemberList ( UserName, UserPass )
VALUES ( @UserName, @UserPass)
GO

.vb code behind

Imports System
Imports System.Data
Imports System.Data.SqlClient


Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents lblUserName As System.Web.UI.WebControls.Label
Protected WithEvents lblUserPass As System.Web.UI.WebControls.Label
Protected WithEvents txtUserName As System.Web.UI.WebControls.TextBox
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents frmMyForm As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents sqlCmd As System.Data.SqlClient.SqlCommand
Protected WithEvents txtUserPass As System.Web.UI.WebControls.TextBox

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
Me.sqlCmd = New System.Data.SqlClient.SqlCommand()
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "data source=THIRDEYE;initial catalog=SQCTEST;integrated security=SSPI;persist sec" & _
"urity info=False;workstation id=THIRDEYE;packet size=4096"
'
'sqlCmd
'
End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

sqlCmd.CommandText = "dbo.[NewMemberInsert]"
sqlCmd.CommandType = System.Data.CommandType.StoredProcedure
sqlCmd.Connection = SqlConnection1
sqlCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(10, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
sqlCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UserName", System.Data.SqlDbType.VarChar, 100))
sqlCmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UserPass", System.Data.SqlDbType.VarChar, 10))
sqlCmd.Parameters("@UserName").Value = txtUserName.Text
sqlCmd.Parameters("@UserPass").Value = txtUserPass.Text

sqlCmd.Connection.Open()


End Sub
End Class

Now...the error

Server Error in '/EEscape' Application.
--------------------------------------------------------------------------------

Login failed for user 'THIRDEYEASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'THIRDEYEASPNET'.

Source Error:


Line 54: sqlCmd.Parameters("@UserPass").Value = txtUserPass.Text
Line 55:
Line 56: sqlCmd.Connection.Open()
Line 57:
Line 58:


Source File: C:InetpubwwwrootEEscapelogin.aspx.vb Line: 56

Stack Trace:


[SqlException: Login failed for user 'THIRDEYEASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
EEscape.WebForm1.btnSubmit_Click(Object sender, EventArgs e) in C:InetpubwwwrootEEscapelogin.aspx.vb:56
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

View 2 Replies View Related

Linking Form In MS Access To Oracle

May 9, 2008

hello

we suppose to link the form in MS Access with Oracle

can anyone tell me how to write the code for these buttons

i tried to write as I learned in VB.NET,
But it seems doesn't work :(

http://www3.speedyshare.com/data/191404757/10803567/78224332/db2.jpg

View 2 Replies View Related

SQL Server Login Form For Access

Jul 20, 2005

Hi there...I use SQL server integrated security so when a user opens a database inaccess it prompts the username & password in a small popup box onconnection, but I'd like to use my own customised form for theauthentication process, is this possible? I do know that this login popboxis displayed before any forms are loaded, can it be said that on databaseconenct that the form is opened? How will I transfer the values entered intothe login form to the sql server for authentication?Thanks alot in advanceRudi Groenewald

View 3 Replies View Related

Import Form Access And Transactions

Oct 1, 2007

I'm trying to import data from Access table using DataFlow with TransactionOptions- Required.
I just want to "remove" (rollback) all records which my SSIS Dataflow inserts into SQL Server.
First I tried to use normal Jet 4.0 provider - but it causes strange error.
Then I tried to use .NET Jet 4.0 provider - it produces this error :






Code Block

[DataReader Source [540]] Error: System.InvalidOperationException: The ITransactionLocal interface is not supported by the 'Microsoft.Jet.OLEDB.4.0' provider. Local transactions are unavailable with the current provider. at System.Data.OleDb.OleDbConnectionInternal.EnlistTransactionInternal(Transaction transaction, Boolean forcedAutomatic) at System.Data.OleDb.OleDbConnectionInternal.EnlistTransaction(Transaction transaction) at System.Data.OleDb.OleDbConnection.EnlistTransaction(Transaction transaction) at Microsoft.SqlServer.Dts.Runtime.ManagedHelper.GetManagedConnection(String assemblyQualifiedName, String connStr, Object transaction) at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90.AcquireConnection(Object pTransaction) at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)
Any ideas how to do this? I really need transactions in my solution. With Excel file it works fine.
Thanks for help.

View 1 Replies View Related

Fails When Use MS Access Datasourse And Ran Form SQL Job (Fine In IDE)

Dec 19, 2007

Hi,

I have created a relatively simple SISS package for MS SQL server 2005 SP1, the package runs without issue when started from the development environment, but fails when ran via a SQL Job.


I have other SISS jobs which run without any problems, the difference with this one is that it doesn€™t just access data the the MS SQL server databases, but it also accesses an external MS Access 2003 database (emptys tables then repopulates based on data in MS SQL)

The database is held on a network share, so I would imagine the issue is that the SQL job is ran under a different security context. Originally it was ran under €œSERVERNAMESYSTEM€?, but I created a new credential on the server giving it my own username and password, I then added a proxy to the server which used the new credietial and was given access to all sub systems.


The SQL job step was setup to run under this proxy, but still failed even though the user name on the credentials had access to the MS Access database on the network share & also matched the package CreatureName, allowing the data to be read as EncryptSensitiveWithUserKey was set in the package.


The SISS package was created by using the wizard, no ODBC connection was setup on the server.
The job history shows €œExecuted as user: ADMINusername. The package execution failed. The step failed.€?
I have also tried this with a protection level of ServerStorage



Any sugestions?

View 4 Replies View Related

Remote Access For Windows Form Application

Jan 10, 2007

I have a windows based software application that connects remotely to a sql server 2005 and calls stored procedures. There is someone that I work with that is cautioning the company strongly that this is a bad thing to do in terms of security. Isn't this a very common thing to do? Assuming that the SQL Server installation is setup appropriately. Is this a bad practice?

View 4 Replies View Related

Using Access Form Control As SQL Function Criteria

Jul 28, 2006

I have a combo box named [myControl] on an Access form that I can use to select/enter a site name (ABC). There is a button on the same form that runs a report. The underlying record source for the report is a SQL Function. Is there an easy way to pass the combo box value to the SQL Function so that only records for site 'ABC' are displayed in the report? I tried Forms![myForm]![myControl] in the criteria box of the Function and it did not work. THANKS!

View 3 Replies View Related

How To Access Static Global Variables In WPF Form

Dec 5, 2007



Hi,

can i keep my global variables in app.xaml.cs file.

if yes then how will i access those variables in MyFirstApp.xaml.cs file??

if no then what is other alternate to create global variables so that it can be access through out the project??

thanx alot
Mohan

View 4 Replies View Related

Filter Records In Access 2003 Project Form

Mar 6, 2008

I am trying to filter the records in an Access2003 project form using data from a control in a different form. I define the variable in form1 as RegKeyWord. The record source for form2 ends with WHERE CustomerName Like RegKeyWord. I receive the error Invalid column 'RegKeyWord'
Can anyone help?

View 1 Replies View Related

Can Create Access Form Layout Based On Table From Sql?

Sep 25, 2006

Hi,

Can this be done? Please advise. Thanks.Is there any template available in sql for creating forms?

View 1 Replies View Related

Import Data Form Access To Sql Server 2005

Feb 20, 2007

I have a database in ACCESS and i want everytime that there is a change made in Access the cude in SQL server to be automatically updated .Is there a way that this can be done with Integration Services?

View 1 Replies View Related

How To Make Form To Delete Record From Table In Access 2002

Jun 29, 2004

I like to give First Name and Last Name in two different text box and then hit the delete button (command button). Then it will do a query to find the person and delete the corresponding record from the table. Any kind of help will be appreciated. Thank you.

View 1 Replies View Related

Passing Variables From Access To SQL

Apr 24, 2001

Hi,
I have created a view. However this view needs a specific variable that a user has inputted in Access. The variable I need to pass into the first view is a DocketID..Similar to a StoreID. I then must run the second view, which also depends on the same DocketID. Finally I must run a final query that takes the result from the second view, which takes the results of the first view.
Basically, I want to pass the variable from my VBA application to the SQL statement. I have been reading, and it seems that like in VB I must declare a local variable in a DECLARE statement. Is that right?
How would I pass the variable that can be held in the VBA application ex. DocketId = 220 and pass that 220 to my SQL statement which is running is SQL 7.0. Most of the statement will be running in SQL, not the VBA application.

View 4 Replies View Related

How To Form Query?

Jul 24, 2004

i am using this statement

select dateadd(dd,1,20010331)


and it's throwing an error

Arithmetic overflow error converting expression to data type datetime.

what's wrong?

View 2 Replies View Related

How To Form The Query

Apr 5, 2008

I have two tables. The table is below.

Table name 1 : Income
Income RentMonth
1500 Jan
1500 Feb
1500 Apr

Table name 2 : Expense
Expense ExpMonth
200 Jan
300 Mar
400 Apr

The result table becomes (Profit=Income-Expense)
Profit Month
1300 Jan
1500 Feb
-300 Mar
1100 Apr

But I form the query by join the both Income and Expense tables to subtract the Income and Expense month wise.

But one moth is in one table the same month is not in another table.

For Example Feb month is in Income table, but not in Expense table.And Mar month is in Expense table and not in Income table. So how will I form the query to achieve my result table as i indicated above. Kindly help me.

Kamal.

View 2 Replies View Related

How To Form This Query

Jan 14, 2007

I have a table SIM_Temp where I ahve three fields val1,val2,val3. I have some data like

SIM_Temp
--------


Val1----------Val2-------------Val3
===================================



AIRMECH------172371.13---------2004
AIRMECH------4269.5------------2003
ETA----------2871704.6724------2005
ETA----------6244149.0769------2004
ETA----------9046873.6504------2003


What I want is, I want this to be read like

CustomerName 2003------------2004----------2005

AIRMECH------------4269.5---------172371.13-----Nil
ETA--------------9046873.6504-----6244149.0769--9046873.6504


Please advice me, how could I do this.

Thank you
Ceema

View 7 Replies View Related

How To Form This Query

Jan 17, 2007

I have a table SIM_TempCustomer where I have 5 fileds nad Values Like


SIM_TempCustomer
----------------

Val1.........Val2.........Val3.........Val4.........Val5
---------------------------------------------------------
A.............NUll........1.............Null.........3
B.............Null........Null..........Null.........2
C.............Null........6.............12...........Null


What I want i, if there is any value in any fields, other null values
in the field should be replaced by 0, if all the rows of the filed
are null, simply leave as it is....


Like the select statement of this SIM_TempCustomer should give a result like


Val1.........Val2.........Val3.........Val4.........Val5
---------------------------------------------------------
A.............NUll........1.............0............3
B.............Null........0.............0............2
C.............Null........6.............12...........0


Could any one help me.

Thanks
Ceema

View 1 Replies View Related

Passing Variables From Access Forms To Sp's

Mar 12, 2006

Hi everyone,

passing variables (values) from a form (MS Access Project) to a stored procedures in order to select records shouldn't be all that difficult. However after searching for hours and hours in various forums and discussions i'm still nowhere. I really hope someone can give me the missing hint.

OK All I whant to do is select data from the sql server via an access interface. the value entered into the access form by the user (for example the client name) should then be transferred to the stored procedure which will then return all the records of the chosen client.

The simple task of transferring this form value to the stored procedure is driving me crazy. Does anyone have an idea.

Thanx in advance

Guido

View 5 Replies View Related

Passing DataSet To MS Access Report

May 28, 2007

I have many MS Access reports that process recordsets obtained from a MySQL database, based on a user-selected date range. This uses VBA and input boxes. I'm now creating .aspx pages to get the user input via the web, and am successful in creating a DataSet. My .aspx.vb code includes using Automation to open the Access report in Snapshot Viewer (DoCmd.OutputTo). How do I pass the DataSet to MS Access to replace using recordsets?



My VBA code in Access used to be this:




Code Snippet

Dim ws As Workspace
Dim strConnection As String
Dim dbs As Database

Dim rst_chg As Recordset

Set ws = DBEngine.Workspaces(0)
strConnection = "ODBC;DSN=xxx;DATABASE=xxx;" _
& "SERVER=10.1.144.xxx;" _

& "UID=xxx;PWD=xxx;PORT=xxx;OPTION=0;" _

& "STMT=set wait_timeout=100000;;"




Set dbs = ws.OpenDatabase("", True, True, strConnection)

Set rst_chg = dbs.OpenRecordset("SELECT ...")

'process the recordset ...




I'm thinking I should be able to eliminate most of this code and Set rst_chg = DataSet. I've been successful with using WriteXml in the .aspx.vb page and Application.ImportXML in my VBA to pass the data using XML, but this writes to the hard drive, and also creates a database in Access (overhead I would rather not have to deal with). Again, is there a way to open the DataSet directly in my VBA code?



Thanks,

Guy Rivers

View 1 Replies View Related

Need Help With Sql Query Statement In ASP Form

Jan 28, 2008

I have an ASP form that takes the information that is entered on the form and inserts it into a Microsoft Access database.  It works great.  In addition to the fields from the form, I also want to add the current date into the InitDate field.  How would I modify the SQL query below to insert the current date into the COS database? conn.execute SqlQry        Sql =         "INSERT INTO COS ([Name of School], [Director of COS], [Address], [City], [State], [zip], [PhoneNumber], "        Sql = Sql &    "[general_notes], [type], [DEPT], ) "  
     Sql = Sql &    "VALUES ('" & m_CompanySchoolName & "',
'" & m_FullName & "', '" & m_StreetAddress & "', '"
& m_City        Sql = Sql &    "', '" & m_State &
"', '" & m_Zip & "', '" & m_TelephoneNumber & "', '"
& m_Message & "', 'COSMETOLOGY', '"        Sql = Sql  & m_Department &    "', '" & m_EmailAddress & "')"                response.write Sql        response.end        conn.execute Sql       

View 14 Replies View Related

SQL Query Question In My Web Form - Help

May 15, 2008

Greetings!
Is this a good SQL query to access two columns in my database and present this data in my web app?
string DataBaseCommand = "Select UserName, [Password] from PatientDemographics Where UserName = '" + txtUserName.Text + "' && [Password] = '" + txtPassword.Text + "'";
Thank you,
 
Eduardo

View 4 Replies View Related

SQL Server 2014 :: Loop And Query CSV Files In Folder Using Union All Query To Form Resultant Table On Server?

Jun 27, 2014

I am trying to run a UNION ALL query in SQL SERVER 2014 on multiple large CSV files - the result of which i want to get into a table in SQL Server. below is the query which works in MSAccess but not on SQL Server 2014:

SELECT * INTO tbl_ALLCOMBINED FROM OPENROWSET
(
'Microsoft.JET.OLEDB.4.0' , 'Text;Database=D:DownloadsCSV;HDR=YES',
'SELECT t.*, (substring(t.[week],3,4))*1 as iYEAR,
''SPAIN'' as [sCOUNTRY], ''EURO'' as [sCHAR],

[Code] ....

What i need is:

1] to create the resultant tbl_ALLCOMBINED table

2] transform this table using PIVOT command with following transformation as shown below:

PAGEFIELD: set on Level = 'Item'
COLUMNFIELD: Sale_Week (showing 1 to 52 numbers for columns)
ROWFIELD: sCOUNTRY, sCHAR, CATEGORY, MANUFACTURER, BRAND, DESCRIPTION, EAN (in this order)
DATAFIELD: 'Sale Value with Innovation'

3] Can the transformed form show columnfields >255 columns i.e. if i want to show all KPI values in datafield?

P.S: the CSV's contain the same number of columns and datatype but the columns are >100, so i dont think it will be feasible to use a stored proc to create a table specifying that number of columns.

View 9 Replies View Related

MS GRAPH, PASSING PARAMETERS, ACCESS PROJECT

Jul 20, 2005

How to pass parameters to MS Graph (row source is a stored procedure withparameters) placed in Access Project form ?The problem is that there is no Input Parameters property on the graphobject...

View 1 Replies View Related

Passing Null Value From Front End Access To SQL Back End

Dec 19, 2007

Hi,

I'm not sure if this question should be in this thread but anyway...

I have a form (Mricosoft Access front end) in which the user enter a Pending Date in one of the fields. The date is populated into my backend (SQL Server) withouht problems.
Whenever the issue which had the pending date in the field is resolved I'd like to delete this date from this field and also from the back end. At the moment I'm not being able to pass the "value" Null to my back end (probably because it's a datetime type). I've searched the net throughout and I couldn't find a way around it. Only found solution to when the data is not date but numbers/letters, etc... Any ideas on how can I sort this out?

Many thanks
Emanuel

View 3 Replies View Related

One Form To Update Different SQL Tables Based Upon Form Selection

Apr 16, 2008

Hello,
My company Intranet has a form that agents can use to post their comments about the company to upper management, but our customer service department would like to modify the form so that the agent has to pick from a comment type.
The dropdown options on the form will be as follows:
ComplimentsComplaintsGeneral CommentsSuggestions
Each dropdown option has a designated table in a SQL DB.Using postback on the same page, I need to change which fields of the form are visible based upon which dropdown selection the user chooses, and I need the fields to then be inserted into the table that corresponds with the dropdown selection item.
For example: If the Compliments dropdown selection is picked, I need a text box to show for the user's location, the name of the customer, account number, and the message box. Once the submit button is clicked, the characters in these boxes need to be inserted into the Compliments table using its data adapter.
However, if the user selects Suggestions, the name of the customer and the account number should not be visible, since these fields do not exist and when the submit button is pressed, the Suggestions table should be updated.
If you need more information, I will provide whatever is needed.
As always, thanks for everyone's assistance.
Chris

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved