Access 2003 / SQLSEE 2005 - Using Forms To Filter Recordsets

Aug 7, 2006

I upsized an Access 2003 database to SQL Server Express Edition 2005, and have converted all tables, queries, reports and macros successfully so far. The snag I'm running into involves using macros embedded in buttons on certain forms using Access as the frontend.

With these forms, the idea is to navigate to a certain record, and hit a button to bring up a print preview view of a report. Based on the record you're looking at in the form, it should check against the data in the table to which it refers, and pull up a single record in the report.

In access as a standalone, using the OpenReport command, the code was as follows:

[MRB Report Data]![MRB Report Number]=[Forms]![MRB Data Input]![MRB Report Number]

MRB Report Data is the table containing data, and MRB Report Number is the primary key (autonumber). MRB Data Input is the form in question, and the second MRB Report Number is the control field that references back to the MRB Data Input table.

When I try to run this using Access as a frontend, an error occurs at the first '!' - is there a different syntax I need to specify to reference a form in this case?

Thanx in advance.

View 4 Replies


ADVERTISEMENT

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

SQL Express 2005 Forms: Default Field Format After Access Up-conversion

Apr 12, 2008

I am converting an Access 2003 database into SQL 2005 Express for purposes of evaluating the SQL server environment as a future home for my data. One of the motivating factors in the conversion is the integration of LINQ with VB 2008.

Assuming that there was no conversion tool to migrate Access forms for use with SQL and VB 2008, I converted the Access data table and used the VB 2008 form designer to databind textbox controls to fields in the converted SQL database. Here are some basic questions:


The conversion from Access to SQL apparently did not include the default numeric formatting (currency, percentage, etc.) which was part of the Access data table. Is there a place in the SQL server environment to supply a default data format so that forms and reports referencing the field do not need to be manually formatted for each reference?

After converting the data table and spending 2 hours designing the dataform for the 80+ fields, I inadvertantly changed the table structure and found that the dataform was not happy (oops). I corrected the databindings manually for the few errant field references, but wonder if there is some wizard to do this automatically?

Is there a way to print out the dataform itself? I used the following code snippet in my Access form code-behind and I wonder if there is an equivalent VB 2008 function:


Code Snippet


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection


Finally, Access can instantly change from dataform to datasheet presentation screens. Can this be done in VB 2008 with two views simultaneously presenting the same SQL data?

Please excuse my naivete, but in contrast to Access 2003 where program functionality is encapsulated into readily apparent controls, menus, and dialogs, the SQL server environment seems foreign, spartan, and all the words are different. Thanks, -BGood

View 3 Replies View Related

Trying To Access SQL SERVER 2005 With Access 2003

Dec 18, 2006



I am trying to connect through ODBC connectivity, but it will not allow me to do so. I have investigated this matter. It leads me back to the server, because as I was configuring my client side database. It kept asking for the DSN(datasource name), but I was unable to choose one because there wasn't one to choose. Which is my current dilemma, How can I do this and have it available to choose from the server to satisfy the Access database?

I went to the domain where the software resides but I don't know what steps to take? I also found an interesting piece on microsoft about Kerberos, but I can't follow along according to the instructions it has. I have Access 2003 & SQL SERVER 2005, HELP...!

Basically, this is right off the heels of the install. I setup the server without the connectivity, but it is running the current configuration.

View 7 Replies View Related

Learn To Access Stored Procedures With ADO.NET 2.0-VB 2005:How To Work With Output Parameters && Report Their Values In VB Forms?

Feb 11, 2008

Hi all,

In my SQL Server Management Studio Express (SSMSE), pubs Database has a Stored Procedure "byroyalty":

ALTER PROCEDURE byroyalty @percentage int

AS

select au_id from titleauthor

where titleauthor.royaltyper = @percentage

And Table "titleauthor" is:
au_id title_id au_ord royaltyper




172-32-1176
PS3333
1
100

213-46-8915
BU1032
2
40

213-46-8915
BU2075
1
100

238-95-7766
PC1035
1
100

267-41-2394
BU1111
2
40

267-41-2394
TC7777
2
30

274-80-9391
BU7832
1
100

409-56-7008
BU1032
1
60

427-17-2319
PC8888
1
50

472-27-2349
TC7777
3
30

486-29-1786
PC9999
1
100

486-29-1786
PS7777
1
100

648-92-1872
TC4203
1
100

672-71-3249
TC7777
1
40

712-45-1867
MC2222
1
100

722-51-5454
MC3021
1
75

724-80-9391
BU1111
1
60

724-80-9391
PS1372
2
25

756-30-7391
PS1372
1
75

807-91-6654
TC3218
1
100

846-92-7186
PC8888
2
50

899-46-2035
MC3021
2
25

899-46-2035
PS2091
2
50

998-72-3567
PS2091
1
50

998-72-3567
PS2106
1
100

NULL
NULL
NULL
NULL
////////////////////////////////////////////////////////////////////////////////////////////
I try to do an ADO.NET 2.0-VB 2005 programming in my VB 2005 Express to get @percentage printed out in the VB Form1. I read some articles in the websites and MSDN about this task and I am very confused about "How to Work with Output Parameters & Report their Values in VB Forms": (1) Do I need the Form.vb [Design] and specify its properties of the object and classes I want to printout? (2) After the SqlConnectionString and the connection.Open(), how can I bring the value of @percentage to the Form.vb? (3) The following is my imcomplete, crude draft code:

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

Public Class Form1

Dim connectionString As String = "Data Source=.SQLEXPRESS;Initial Catalog=pubs;Integrated Security=SSPI;"

Dim connection As SqlConnection = New

SqlConnection(connectionString)

Try

connection.Open()

Dim command As SqlCommand = New SqlCommand("byroyalty", connection)

command.CommandType = CommandType.StoredProcedure
...................................................................
..................................................................
etc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
From the above-mentioned (1), (2) and (3), you can see how much I am lost/confused in attempting to do this task. Please help and give me some guidances and good key instructions for getting the output parameter printed out in the FORM.vb in my VB 2005 Express project.

Thanks in advance,
Scott Chang


View 11 Replies View Related

SQL 2005 And Access 2003

Oct 11, 2005

Is there a patch available for Access 2003 that will allow it to interoperate fully with SQL 2005?

View 1 Replies View Related

SQL 2005 Express And Access 2003 SP2 Adp. Please Help

Mar 22, 2007

Hi all,

I have SQL Server 2005 Express running and I am creating a database through access (Access 2003 SP2) and no problem it creates the database...

But when I try to create other objects like views and database diagrams, I get the message below which is quite detailed but I just don't know where to get the service packs or updates needed to have this problem solved. Can anyone point out what the problem and the fixes are?

Here is the message that I get:

"This version of MS Office Access doesn't support design changes with the version of MS SQL Server
your access project is connected to. See MS Office Update Website for the latest information and
downloads (on the Help menu, click Office on the Web). YOur design changes will not be saved.

You have connected to a version of SQL server later than SQL Server 2000. This version of Visual Studio
or Access that you are using was released before teh version of SQL Server to which you are connected.
For this reason you might encounter problems.

Please check with MS to see if there is a service pack that you should apply to Visual Studio or Office
in order to get support for the version of SQL Server to which you are connected.

You can continue but any new object types might not be enumerated, and it will not be possible to
save any objects or database diagrams thatyou create using the Visual Database Tools."



Thanks

View 3 Replies View Related

Access 2003 With SQL Express 2005

Nov 15, 2006

I am a fresher in using SQL with access.

I am using a code in Ms access to link a table that is in Sql express 2005.

I use this linked table name to download records to the local Access table.

The link is then dropped in Access.

Is there any way to write back records into the linked Sql table from Access.

It does not allow me to delete / add / modify records of a linked table.

How can I do this.



Thanks

Sjohn

View 1 Replies View Related

Modify VB6 App To Use SQL 2005 Data Instead Of Access 2003

May 19, 2007

I have an existing VB6 application which uses an Access 2003 backend datafile, however, I would now like to modify this to use an SQL 2005 datafile, but I don't know how to go about this or the implications when the application is installed on another machine.



The code I use for accessing the Access 2003 file is below, I want to convert this code to access an SQL 2005 datafile instead, can anyone give me some pointers on the best way to go about this, or code sample.



Dim rst As ADODB.Recordset
Dim dbs As ADODB.Connection

Set rst = New ADODB.Recordset
Set dbs = New ADODB.Connection

dbs.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
strNetworkLocation & "MyDB.mdb; JET OLEDBatabase Password=MyPassword"

With rst
.Open "SELECT TOP 1 * FROM tblProject WHERE pjProject = '" & _
lstProject.Text & "'", dbs, adOpenKeyset, adLockOptimistic
strDrawingRef = !pjStartupDrawing
strProject = lstProject.Text
frmMain.OpenFile
.Close
End With


Thank-you in advance for any help you may provide.



Mandy

View 4 Replies View Related

Using MS Access 2003 Project With SQL Server 2005

Mar 16, 2006

I continue to receive an error that states "The version of Microsoft Access doesn't support design changes with the version of Microsoft SQL Server your Access project is connected to. See the Microsoft update website for the latest information."

I'm using Access 2003 that I ran a database through the Upzinging Wizard with a copy of SQL Server 2005.

I have searched the Office Update pages and can't locate anything that helps, although I'm sure I'm probably missing something.

Any suggestions?

Thanks in advance,

Mike Duke

View 9 Replies View Related

Problem With Compatibility Between Access 2003 And SQL 2005

Nov 26, 2007

In my office, we offer support for applications developed in Access 2003 in a SQL Server 2000 environment, for some of our clients.

In one PC we have installed MsOffice 2003 and recently installed SQL Server 2005 personal edition, but now we have a problem because there is a compatibility problem between them. We need some upgrade for Access to avoid it, but can't find it.

Can We fix this problem, maintainning Access 2003 and SQL Server 2005 personal edition and maintainning the support for our clients?

Notice that our clients can't upgrade, in the short time.








View 1 Replies View Related

Can't Add A Linked Table To SQL Server 2005 With Access 2003

Oct 26, 2006

Hi,

I have an Access 2003 front end that contains a number of linked tables on SQL Server 2005 SE. I recreated the application on a second network for testing and was able to use the Linked Table Manager to refresh the database connections. The problem is when I try and add another linked table. I select Link Tables from the menu and then when I select 'ODBC Databases()' from the 'Files of Type' list box, the Link window closes right away.



Any suggestions?



View 5 Replies View Related

Import Data From Access 2003 To SQL Server 2005 Via T SQL ?

Oct 5, 2007

I have a customer using a web app where the data is drawn from a database in SQL Server 2005.

In addition to its normal tables, the database has two lookup tables which are deleted, recreated, and repopulated once a week. The data for these two tables comes from two queries in an Access database which essentially turn many related tables into two flat tables.

I know this can be done with SSIS, I've done it, I suppose it could be done witth SSMA for Access, but could this operation be done with a stored prodecure ? Most steps would not be a problems. They would be:

- Drop the two tables in SQL Server (no problem)
- Recreate them (no problem, maybe better to just delete all existing records, either way)

- Connect to the query in the Access database (here is where I have questions)
- Simply do an INSERT from the Access query to the SQL table.

So my question is whether we can connect to an Acess query from a stored proc, I suppose using ODBC.

Can this be done? If so how? Are there any papers on this topic?

Msny thanks,
Mike Thomas

View 5 Replies View Related

Access 2003 Crashing When Trying To Query SQL 2005 Table.

Nov 9, 2007



Kind of a weird problem. Just migrated some Access tables to SQL 2005 backend. This is only happening on one users machine, WinXP and Access 2003 with the linked tables to SQL 2005. When they try to run a query that has a date criteria, Access will crash. Any other type of criteria, the query works fine. Things I have tried:
1) Installing Office Service Pack 3
2) Repairing Office 2003

Thanks.

View 1 Replies View Related

Access 2003 To SQL Server 2005 Express No Hyperlink

Dec 1, 2006

I upgraded an Access 2003 database to SQL Server 2005 Express with the upsize wizard- worked great! Have a field that needs to be a hyperlink data type. There is no datatype in SQL that is hyperlink. Even if it were a text field, possibly inserting a hyperlink would work, but the insert hyplink in Access is unavailable, because the datasource is sql, maybe. I have a command button that ties to this function which won't work, obviously since it is not available. I need this field, it points to a file containing data that is being imported into the database. Huge piece of the database functionality. Making it easy for the user to find the file and using the vba to convert the data.

Saw the option of jump to url, but I don't think that will work? couldn't find the exact syntax either.



Any ideas would be greatly appreciated!

Robin

View 6 Replies View Related

Problem With Access 2003 And Sql Server 2005 Express Connection

Dec 5, 2007

I have an Access 2003 project (sp2) and the data in SQL Server 2005 Express.
My problem is when I try to make querys, diagrams, etc in Access, a warning tell me that I have installed a version of Access that is older than the version of SQL and all the designs that I make not be saved, and recommend a service pack for Access 2003 to correct the problem.
Can anybody help me, where is this SP??

View 1 Replies View Related

Poor Preformance Usinng Sql 2005 With Access 2003 Application

Jan 1, 2007

we have run access 2003 application using SQL 2005 server
and the data transfer rate is extreamly slow.
we are using ODBC connection
and the access apllication works very fast with SQL 2000.

we have the tested the comptabilty of the application to SQL 2005 with Microsoft wizard and it had no problems.
even when i run simple application on the sql 2005 server, it runs very slowly.

i am using the MDAC clients ODBC component and the SQL Native Clients one.
which eliminates the possibilty of network problem.

what could be the problem???

View 1 Replies View Related

How To Link To An Existing SQLExpress 2005 Table From Access 2003

Nov 22, 2006

I initially created an Access application within Access 2003 which I subsequently migrated to SQLExpress 2005 (Tables only) using Microsoft SQL Migration Assistance for Access 2003 (SSMAA) and continue to use Access 2003 as a front end, this really was easy and worked perfect. Now I added a new table to my SQLExpress DB and need to link to it from my Access application but can not find a way to do so in the same way that the SSMAA does. I need to run the Access 2003 application in share mode from multiple PC in the LAN. If I try linking to the table using an ODBC connection I can only access from the PC where the link was done! Any ideas? THanks in advance.

View 4 Replies View Related

Problem To Connect Access 2003 To SQL Server 2005 Express

Jan 10, 2006

Hello,

after successfully connect Access to the Server I want to add a table. I got an error message:

With this version of MS Office Access you are not able to make any drafts because this version of SQL server you are connected to does not support this. Check the MS Office update website for the newest downloads.

You habe connected to a version of SQL server which is newer than SQL server 2000.

Versions:

SQL Server runs on a MS Server 2003 SP1

Access 2003 (11.6566.6568 SP2) on an MS XP Pro SP1

all on actual patch level. Any ideas what's wrong?

:-) Klaus

 

 

View 14 Replies View Related

Is There A Way To Import Tables From Microsoft Access 2003 With SQL Server 2005 Express?

Apr 21, 2006

Hi,

I've just installed SQL Server 2005 Express Advanced and I haven't found a way to import Microsoft Access 2003 files. Is there a way to do it?

Thanks in advance,

Sergio Oliveira

View 1 Replies View Related

SQL Svr 2005 Nvarchar(MAX) Interpreted As TEXT Fiields When Linked To MS Access 2003

Apr 4, 2008



Hi, We have moved our Access 2003 database to SQL Server 2005. A number of the original tables contained MEMO fields and these became nvarchar(MAX) fields in SS 2005. We continue to use the original Access application and therefore have linked the tables to the Access application via ODBC connection. However, the fields that were originally Memo in Access native tables are brought over as TEXT fields (255 char limit) by the linking process.

Is there a way I can link the tables and have those big text fields be Memo fields in the linked tables?? Or is there some way to work around this? (Moving to Access 2007 is not an option at this time.) I would really appreciate any suggestions!
Thanks.

View 1 Replies View Related

SSIS Package Error : Export Data From SQL Server 2005 To Access 2003.

Oct 9, 2007



I am exporting 350 tables data from SQL Server 2005 to Access 2003.and getting the below error.

SSIS package "Package2.dtsx" starting.

Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.

Information: 0x40043006 at Data Flow Task, DTS.Pipeline: Prepare for Execute phase is beginning.

Error: 0xC0202009 at Package2, Connection manager "DestinationConnectionOLEDB": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.

An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unspecified error".

Error: 0xC020801C at Data Flow Task, Destination 64 - CLIMBINGEXP [8065]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "DestinationConnectionOLEDB" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

Error: 0xC004701A at Data Flow Task, DTS.Pipeline: component "Destination 64 - CLIMBINGEXP" (8065) failed the pre-execute phase and returned error code 0xC020801C.


Any clue?

View 2 Replies View Related

Outlook 2003 Filter SQL Tab To Compare The Values Of Two Fields In A Given Contact.

Sep 28, 2007

Hello and Thank You in advance:


I would like to Use the SQL Tab in the Filter Selection of the View-Modify Current View Option in Outlook 2003.
I am specifically trying to create a statement that only displays those Contacts that have a Modified Date that is different than the Created date. In other words I want to view all the records that have been modified at any time after the date of their creation.

I have been unable to create a SQL statement that compares the Created and Modified fields in the Contacts. Would you please explain and show what the correct syntax is in order to compare the values of two fields within a given Contact?


These are all examples of what I have tried and that have not worked. I cannot find documentation for this anywhere only small articles here and there that are not enough for me to develop a complete answer from:

(("urnchemas:calendar:created" >= '1/1/2001 12:00 AM' AND
"urnchemas:calendar:created" <= '12/31/2001 12:00 AM')
AND ("urnchemas:calendar:created" <> "urnchemas:calendar:lastmodified" ))
("urnchemas:calendar:created" <> "urnchemas:calendar:lastmodified" )

(("urnchemas:calendar:created" >= '1/1/2001 12:00 AM' AND
"urnchemas:calendar:created" <= '12/31/2001 12:00 AM') AND
("DAV:getlastmodified" >= '1/1/2001 12:00 AM' AND
"DAV:getlastmodified" <= '12/31/2007 12:00 AM'))

("urnchemas:calendar:created" <> "DAV:getlastmodified")
("DAV:getlastmodified" <> "urnchemas:calendar:created")
("DAV:getlastmodified" <> 'urnchemas:calendar:created')
("urnchemas:calendar:created" <> 'DAV:getlastmodified')

View 2 Replies View Related

Updating SQL With Access Forms

Oct 2, 2001

Hello all, here is my question,
I have an Access 97 database linked to a SQL Server 7 db. All primary keys/relationships/ec have been created in the SQl database and I can update forms fine from the table view. When I try to use the Access forms to update data, I cannot update anything. I believe that a possibility for this may be that the Autonumbering feature of the primary key is held in SQL where before it was held in Access so the form cannot update without a number already apparent to the form but I am probably way off. I tried creating a whole new form completely based on the linked tables instead of using the old Access forms but I recieved the same results. Anyone have this problem or know how to fix it?


Thank you in advance.

View 2 Replies View Related

Replacement For Access Forms

Aug 2, 2007

Just wondering if anyone has any suggestions for a replacement for Access Forms once I move the tables etc to SQL 2005?
Does SQL 2005 have any form building functionality like Access?

View 1 Replies View Related

Replacement For Access Forms

Nov 1, 2007



Hi,
We had to migrate from MS Access 2003 to SQL Server 2005 due to some project requirements.

We had used Forms, earlier, to enter data to the Access database.

I understand SS2005 doesnt support forms.

Can you suggest any other way of creating an equivalent entity as that of forms, so as to enable users to enter data to the SS 2005 DB easily.


Thanks in Advance for your help,
Regards,
Sundar




View 4 Replies View Related

Help - Syncronizing Forms In Access 2000

Jul 20, 2004

regular access db - usually use sub-forms or tabs - this time I want seperate forms - have linked fields - but can't final code line in "open form" button command. Any suggestions welcome. Denny :(

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

Adding Data To SQL Via Access Forms

Nov 14, 2007

I try to add data to SQL via Access Forms. When I add a data and open tables in Access which are connected to SQL, I can see my new datas. But if I open tables in SQL Server Management Studio I can not see any of those new datas. What should I do to solve this problem. I will be very happy if you can help me about this matter.
Thanks in advance...

Berk

View 3 Replies View Related

SQL SERVER User Interface Through ACCESS Forms

Jul 20, 2005

Hello,I would like to know if it is possible to create a form in Access2000,which would function like a calendar for 8 operating rooms inhospital, showing which hours are those closed for a specific date.For this intersection I would like to be appeared the name of thedoctor, the name of the patient and the kind of operation.Furthemore I would like this intersection to be marked in the calendarwith a colour, showing that this room is closed for that time.The data for this form are going to be extracted from a table storedin SQL Server 2000.Generally the whole application is stored in SQL Server( storedprocedures, tables, diagrams etc.)1)How this can be done? Is this going to be through VB or not? Can Imake a template in Excel spreadsheet put it in a formand apply code on it?I would like also to make forms(in Access) for user-entry data thatwill use stored procedures of SQL Server with pushing the OK button.The stored procedures would take as arguments the user-entry data fromtheforms.I thought to make a pass-through query which would use a VB functionand would take as arguments the user's valuesand after would pass these values in the stored procedures.2)Can this be done through the pass-through query, that is SqlServer "understands" VB or better Access pass-through query processthe VB commands before be connected with the Sql Server?What do you think of this as an idea?My problem is that I really don't know how to combine VB code withTransact Sql code.Can you give an example or any ideas where I can find the relativeinformation?Thanks you in advance.

View 3 Replies View Related

Access 2007 Linked Tables (vs Access 2003)

May 15, 2007

We migrated a MS Access 2003 mdb into MS Access 2007. The mdb has linked tables to SQL Server via a DSN and utilizes a mdw file. In 2003, the username/password is "passed" to SQL Server, so the UID/PWD that is used for opening the mdb, is used in SQL Server.



Opening the same file in 2007 using the same mdw, gives a secondary login on SQL Server.



Is there a way to have MS Access 2007 pass the UID/PWD to SQL Server on linked tables, the same way that 2003 does?



Thanks!

View 1 Replies View Related

Autogrow Of File 'FORMS' In Database 'FORMS' Cancelled Or Timed Out After 30547 Ms.

Jun 26, 2007

Afternoon

I'm getting the below error message:

Autogrow of file 'FORMS' in database 'FORMS' cancelled or timed out after 30547 ms. Use ALTER DATABASE to set a smaller FILEGROWTH or to set a new size.

FORMS.LDF file is 7613952 KBand the growth is 512MB .

By how much should I set the filegrowth? The users are complaining that the application is freezing on them.

This is sqlserver 2000.

View 6 Replies View Related

Named SQL 2005 Instance Multiple Active Recordsets-C# Stored Procedure-Connection String

May 7, 2008

I am working on a C# stored procedure for SQL 2005, and i've uncovered a couple questions.

First a description of the procedure:

I have a series of equations taking place to calculate a score based on activities in which the user participated in, that will give them an over all grade or rating. The calculations currently take place in the database, and I am moving this from T-SQL to C# CRL.

1. In order to connect the stored procedure to the database I use a SqlConnection and a SqlCommand to execute either dynamic sql or a stored procedure to return data to a data reader. Is there an easier way to connect to the database? In SSMS if i open up the query it knows what database i am connected to. Do I have to make a sql connection in C# stored Procedures?

2. I have multiple functions within the main C# Stored Procedure that I'm working on. This ends up requiring Multiple Active Recordsets. I must set this withing the connection string. Seeing as I'm using a named instance of SQL 2005, I now must put the userid, password, and server name into the code. Is there a more secure way to connect to SQL Server in a C# Stored procedure that allows MARS?

3. I encryped the connection string, and put it into the assembly, I wrote a decryption class, and in the procedure itself everytime I need to refrence the connection string, I call it, decrypt it, and pass it along. But my code to decrypt the connection string is in the compiled DLL, if the server was ever compromised the encrypted connection string and the key to decrypt it are sitting in the DLL. Is there a config file that I can use for C# Stored Procedures?

4. If I have to keep the connection string in the file, then I need to change that per environment. Example I have 3 test environments before production. So I would need to change the connection string for each file. That may be fine for one procedure, but what if I have 20, that will quickly get of hand?

5. Along the security lines, can the assembly for a C# Stored Procedure be called from outside the assembly? From a command prompt, or by a maliceous program? Or could it be called directly by a .NET application instead of going through a T-SQL Stored Procedure that is using
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [PROJECTNAME].[CLASSNAME].[METHODNAME]


Thanks

View 1 Replies View Related







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