From lawhonac at hiwaay.net Fri Feb 1 02:19:40 2013 From: lawhonac at hiwaay.net (Alan Lawhon) Date: Fri, 1 Feb 2013 02:19:40 -0600 Subject: [dba-SQLServer] I Programmer (Web Site) Message-ID: <000001ce0054$e1ecabc0$a5c60340$@net> If you earn your living as a professional programmer (or even if you don't), this web site http://www.i-programmer.info/ is a treasure trove of interesting articles, book reviews, career and certification advice as well as topics of general interest to programmers. Here are two articles addressing SQL Server 2012, Sharepoint, and Microsoft developer certifications. http://tinyurl.com/9wbhcwq http://tinyurl.com/ayqlg6r Here are two "opinion pieces" concerning Microsoft's .NET technology. http://tinyurl.com/3vye9dn http://tinyurl.com/3ts9tyz Alan C. Lawhon From jlawrenc1 at shaw.ca Fri Feb 1 11:03:18 2013 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Fri, 1 Feb 2013 09:03:18 -0800 Subject: [dba-SQLServer] I Programmer (Web Site) In-Reply-To: <000001ce0054$e1ecabc0$a5c60340$@net> References: <000001ce0054$e1ecabc0$a5c60340$@net> Message-ID: <4E4E4969F74C4802A5743AFA23B50AA2@creativesystemdesigns.com> Thanks Alan. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Alan Lawhon Sent: Friday, February 01, 2013 12:20 AM To: 'Off Topic'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] I Programmer (Web Site) If you earn your living as a professional programmer (or even if you don't), this web site http://www.i-programmer.info/ is a treasure trove of interesting articles, book reviews, career and certification advice as well as topics of general interest to programmers. Here are two articles addressing SQL Server 2012, Sharepoint, and Microsoft developer certifications. http://tinyurl.com/9wbhcwq http://tinyurl.com/ayqlg6r Here are two "opinion pieces" concerning Microsoft's .NET technology. http://tinyurl.com/3vye9dn http://tinyurl.com/3ts9tyz Alan C. Lawhon _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Sun Feb 24 16:45:41 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 24 Feb 2013 17:45:41 -0500 Subject: [dba-SQLServer] [AccessD] Bind Form to RecordSet In-Reply-To: <39B1E82B59AE451580BBC11BC7BF89B6@SusanHarkins> References: <39B1E82B59AE451580BBC11BC7BF89B6@SusanHarkins> Message-ID: I'm having another problem, too. I should mention that the BE for this app is a MySQL database. The Access app is hooked to it with ODBC. Everything works as it did when talking to an Access BE. One large impediment: Access can see the tables just fine, but seems unaware of the existence of Views and Stored Procedures in the BE. (Or at least, they're not visible, and setting the form's recordsource to a View that I know is there and know it works, because I can see it in Navicat, just not in Access.) Does anyone know how I can set the RecordSource to a View instead of a Table? Is there some special way to refer to it? dbname.viewName didn't work. Followup question: How to set the RecordSource to the result set returned by a Stored Procedure? I've done this in an ADP before, but that demands a MS SQL BE. I'm going to double-post to the SQL list, because this part of the discussion might belong there. TIA, Arthur On Sun, Feb 24, 2013 at 4:58 PM, Susan Harkins wrote: > Quack! :) > Susan H. > > Ah, Susan! My lovely little duck! I didn't even look up the link you >> provided. I knew at once that you were right. A quick edit and presto. >> >> Thanks! >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/**mailman/listinfo/accessd > Website: http://www.databaseadvisors.**com > -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr From ssharkins at gmail.com Sun Feb 24 18:36:16 2013 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 24 Feb 2013 19:36:16 -0500 Subject: [dba-SQLServer] [AccessD] Bind Form to RecordSet References: <39B1E82B59AE451580BBC11BC7BF89B6@SusanHarkins> Message-ID: <315D9E3F11874BD5B8D453D3D2EADBCC@SusanHarkins> > I'm having another problem, too. I should mention that the BE for this app > is a MySQL database. The Access app is hooked to it with ODBC. Everything > works as it did when talking to an Access BE. ==========I'm not help Arthur -- I tried to learn MySql in its infancy and ran screaming into the night... hair on fire! :) Susan H. From stuart at lexacorp.com.pg Sun Feb 24 18:57:36 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 25 Feb 2013 10:57:36 +1000 Subject: [dba-SQLServer] [AccessD] Bind Form to RecordSet In-Reply-To: References: , <39B1E82B59AE451580BBC11BC7BF89B6@SusanHarkins>, Message-ID: <512AB700.15253.578A52FB@stuart.lexacorp.com.pg> What version of mySQL and ODBC? I just created a view in a MySQL 5.5.20 and linked to it through MySQL OBDC n5.1 Driver with no problems. -- Stuart On 24 Feb 2013 at 17:45, Arthur Fuller wrote: > I'm having another problem, too. I should mention that the BE for this app > is a MySQL database. The Access app is hooked to it with ODBC. Everything > works as it did when talking to an Access BE. > > One large impediment: Access can see the tables just fine, but seems > unaware of the existence of Views and Stored Procedures in the BE. (Or at > least, they're not visible, and setting the form's recordsource to a View > that I know is there and know it works, because I can see it in Navicat, > just not in Access.) > > Does anyone know how I can set the RecordSource to a View instead of a > Table? Is there some special way to refer to it? dbname.viewName didn't > work. > > Followup question: How to set the RecordSource to the result set returned > by a Stored Procedure? > > I've done this in an ADP before, but that demands a MS SQL BE. > > I'm going to double-post to the SQL list, because this part of the > discussion might belong there. > > TIA, > > Arthur > > > On Sun, Feb 24, 2013 at 4:58 PM, Susan Harkins wrote: > > > Quack! :) > > Susan H. > > > > Ah, Susan! My lovely little duck! I didn't even look up the link you > >> provided. I knew at once that you were right. A quick edit and presto. > >> > >> Thanks! > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/**mailman/listinfo/accessd > > Website: http://www.databaseadvisors.**com > > > > > > -- > Arthur > Cell: 647.710.1314 > > Prediction is difficult, especially of the future. > -- Niels Bohr > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Sun Feb 24 19:19:22 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 25 Feb 2013 11:19:22 +1000 Subject: [dba-SQLServer] [AccessD] Bind Form to RecordSet In-Reply-To: <512AB700.15253.578A52FB@stuart.lexacorp.com.pg> References: , , <512AB700.15253.578A52FB@stuart.lexacorp.com.pg> Message-ID: <512ABC1A.31300.579E3DB7@stuart.lexacorp.com.pg> I've also just createa a simple stored procedure in phpMyAdmin - (select * from mytable) and accessed it with a pass-through query. Both the view and query are visible/selectable/usable in a Form's "Record Source" dropdown list. (This is all in Access 2010) -- Stuart On 25 Feb 2013 at 10:57, Stuart McLachlan wrote: > What version of mySQL and ODBC? > > I just created a view in a MySQL 5.5.20 and linked to it through MySQL OBDC n5.1 Driver > with no problems. > > -- > Stuart > > On 24 Feb 2013 at 17:45, Arthur Fuller wrote: > > > I'm having another problem, too. I should mention that the BE for this app > > is a MySQL database. The Access app is hooked to it with ODBC. Everything > > works as it did when talking to an Access BE. > > > > One large impediment: Access can see the tables just fine, but seems > > unaware of the existence of Views and Stored Procedures in the BE. (Or at > > least, they're not visible, and setting the form's recordsource to a View > > that I know is there and know it works, because I can see it in Navicat, > > just not in Access.) > > > > Does anyone know how I can set the RecordSource to a View instead of a > > Table? Is there some special way to refer to it? dbname.viewName didn't > > work. > > > > Followup question: How to set the RecordSource to the result set returned > > by a Stored Procedure? > > > > I've done this in an ADP before, but that demands a MS SQL BE. > > > > I'm going to double-post to the SQL list, because this part of the > > discussion might belong there. > > > > TIA, > > > > Arthur > > > > > > On Sun, Feb 24, 2013 at 4:58 PM, Susan Harkins wrote: > > > > > Quack! :) > > > Susan H. > > > > > > Ah, Susan! My lovely little duck! I didn't even look up the link you > > >> provided. I knew at once that you were right. A quick edit and presto. > > >> > > >> Thanks! > > >> > > >> > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/**mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.**com > > > > > > > > > > > -- > > Arthur > > Cell: 647.710.1314 > > > > Prediction is difficult, especially of the future. > > -- Niels Bohr > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From David at sierranevada.com Mon Feb 25 09:16:50 2013 From: David at sierranevada.com (David Lewis) Date: Mon, 25 Feb 2013 07:16:50 -0800 Subject: [dba-SQLServer] The problem is the query, not the data Message-ID: <8437387186B192498848F1892A41F780015F683C2883@schwarz.sierranevada.corp> Not sure what you mean by 'save the query'... If it is a view, you can script it as 'Drop And Create...' to a new window. You can manually execute any of those statements (first the drop, then modify it as needed, then create it again) as you need to. Message: 1 Date: Wed, 28 Nov 2012 16:07:58 -0500 From: jwcolby To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] The problem is the query, not the data Message-ID: <50B67D2E.1060503 at colbyconsulting.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed No, I am talking about the query itself, not the data. I tried to add something (a field I think) and it allowed me to do so until I tried to save the changes, and then SQL Server threw an error. Tried to copy the SQL to a new query and save, that worked. Dried to delete the old query, SQL Server threw an error. So I have a query which works (can pull data) but cannot be modified or deleted. John W. Colby Colby Consulting Reality is what refuses to go away when you do not believe in it On 11/28/2012 3:45 PM, Martin Reid wrote: > John > > This help > > http://support.microsoft.com/kb/822747 > > > > Sent from my iPad > > On 28 Nov 2012, at 20:43, "jwcolby" > wrote: > > I have not resolved this. The database appears to be corrupt. I can > edit and run it but cannot save edits nor delete the query. > > John W. Colby > Colby Consulting > > Reality is what refuses to go away > when you do not believe in it > > On 11/28/2012 2:04 PM, Francisco Tapia wrote: > did you move on from this one? what version are you on now? How are > you "editing" this query? > > The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. From fuller.artful at gmail.com Mon Feb 25 10:15:25 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 11:15:25 -0500 Subject: [dba-SQLServer] The problem is the query, not the data In-Reply-To: <8437387186B192498848F1892A41F780015F683C2883@schwarz.sierranevada.corp> References: <8437387186B192498848F1892A41F780015F683C2883@schwarz.sierranevada.corp> Message-ID: JC, Presumably when you say "saved query" you mean View. Not sure why you're having problems modifying it, but you could try this approach instead and see what you get: Right-click on the View and generate its Create script to a new query window. Change the CREATE keyword in the script to ALTER. Make your changes to suit. Execute. Inspect the results. HTH, Arthur On Mon, Feb 25, 2013 at 10:16 AM, David Lewis wrote: > > Not sure what you mean by 'save the query'... > If it is a view, you can script it as 'Drop And Create...' to a new > window. You can manually execute any of those statements (first the drop, > then modify it as needed, then create it again) as you need to. > > > > Message: 1 > Date: Wed, 28 Nov 2012 16:07:58 -0500 > From: jwcolby > To: Discussion concerning MS SQL Server > > Subject: [dba-SQLServer] The problem is the query, not the data > Message-ID: <50B67D2E.1060503 at colbyconsulting.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > No, I am talking about the query itself, not the data. I tried to add > something (a field I think) and it allowed me to do so until I tried to > save the changes, and then SQL Server threw an error. > Tried to copy the SQL to a new query and save, that worked. Dried to > delete the old query, SQL Server threw an error. So I have a query which > works (can pull data) but cannot be modified or deleted. > > John W. Colby > Colby Consulting > > Reality is what refuses to go away > when you do not believe in it > > On 11/28/2012 3:45 PM, Martin Reid wrote: > > John > > > > This help > > > > http://support.microsoft.com/kb/822747 > > > > > > > > Sent from my iPad > > > > On 28 Nov 2012, at 20:43, "jwcolby" jwcolby at colbyconsulting.com>> wrote: > > > > I have not resolved this. The database appears to be corrupt. I can > > edit and run it but cannot save edits nor delete the query. > > > > John W. Colby > > Colby Consulting > > > > Reality is what refuses to go away > > when you do not believe in it > > > > On 11/28/2012 2:04 PM, Francisco Tapia wrote: > > did you move on from this one? what version are you on now? How are > > you "editing" this query? > > > > > > > The contents of this e-mail message and its attachments are covered by the > Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are > intended solely for the addressee(s) hereof. If you are not the named > recipient, or the employee or agent responsible for delivering the message > to the intended recipient, or if this message has been addressed to you in > error, you are directed not to read, disclose, reproduce, distribute, > disseminate or otherwise use this transmission. If you have received this > communication in error, please notify us immediately by return e-mail or by > telephone, 530-893-3520, and delete and/or destroy all copies of the > message immediately. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr From fuller.artful at gmail.com Mon Feb 25 11:10:00 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 12:10:00 -0500 Subject: [dba-SQLServer] MySQL not MS SQL question Message-ID: Well, after much experimenting, I am about halfway to my goal. First, a brief description of the scenario: 1. Access 2007 Front End; MySQL Back End, MySQL ODBC 5.2a Driver. 2. Database was ported from Access to MySQL using a utility called MS Access to MySQL (Freeware/DonationWare) 3. Navicat MySQL admin tool. Initially I set up a link to the MySQL database (External Data|More|MySQL ODBC, selected all the tables). In Navicat I created a couple of Views and Stored Procedures in the MySQL database. I created a new connection as before (External Data etc.). This time my two new Views were understood as Tables. I selected the two Views and linked to them. I swtiched to Access and there were the two new Views, listed as Tables. I opened one, then created a form in the usual way. I opened the other and created a form, then closed it. I switched Form1 into design mode, then added a subform and selected the form just created (Form2). This worked just as hoped. Success, as far as it goes. However it does not go as far as I want. What I want to do next is bind a form to the result set returned by a Stored Procedure in the MySQL back end. None of the "obvious" approaches works. So now I'm thinking that what I have to do is: 1. create a command object within VBA code. (Perhaps create a new connection object, too; not sure about that yet.) 2. Populate its attributes with procedure name, indicate that it is a SP. 3. Add parameter objects to suit. 4. Execute the command, assigning the result set to a recordset. 5. Set the form's RecordSet to the recordset just created. 6. In the form close event, close my recordset and set it to nothing. Does that sound about right? Have I overlooked anything? One thing that I do know in advance is that I'm puzzled about the parameter objects. With some exploration I hope to clear up my haze. Does anyone have an example of code that does this, ideally to a non-MS SQL database? TIA, Arthur From jlawrenc1 at shaw.ca Mon Feb 25 12:04:01 2013 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Mon, 25 Feb 2013 10:04:01 -0800 Subject: [dba-SQLServer] [AccessD] Bind Form to RecordSet In-Reply-To: References: <39B1E82B59AE451580BBC11BC7BF89B6@SusanHarkins> Message-ID: Hi Arthur: I have posted this link a number of times and even though it is not specifically and only about your requirement, it does give you a sample of the methods to be able to use ADO to pull data from tables, from any BE and how to then transfer that data to your DAO tables. http://www.databaseadvisors.com/newsletters/newsletter112003/0311UnboundRepo rts.asp This code sample comes from the late 90s and it still works perfectly. If you need details just ask. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Sunday, February 24, 2013 2:46 PM To: Access Developers discussion and problem solving Cc: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] [AccessD] Bind Form to RecordSet I'm having another problem, too. I should mention that the BE for this app is a MySQL database. The Access app is hooked to it with ODBC. Everything works as it did when talking to an Access BE. One large impediment: Access can see the tables just fine, but seems unaware of the existence of Views and Stored Procedures in the BE. (Or at least, they're not visible, and setting the form's recordsource to a View that I know is there and know it works, because I can see it in Navicat, just not in Access.) Does anyone know how I can set the RecordSource to a View instead of a Table? Is there some special way to refer to it? dbname.viewName didn't work. Followup question: How to set the RecordSource to the result set returned by a Stored Procedure? I've done this in an ADP before, but that demands a MS SQL BE. I'm going to double-post to the SQL list, because this part of the discussion might belong there. TIA, Arthur On Sun, Feb 24, 2013 at 4:58 PM, Susan Harkins wrote: > Quack! :) > Susan H. > > Ah, Susan! My lovely little duck! I didn't even look up the link you >> provided. I knew at once that you were right. A quick edit and presto. >> >> Thanks! >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/**mailman/listinfo/accessd > Website: http://www.databaseadvisors.**com > -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stuart at lexacorp.com.pg Mon Feb 25 16:35:11 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 26 Feb 2013 08:35:11 +1000 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: References: Message-ID: <512BE71F.23209.5C2E4ABA@stuart.lexacorp.com.pg> You can "Bind" the recordset from a stored procedure by putting that procedure in a pass-trhough query and "binding" to the query Note the quotes around "bind". Recordset returned by SPs are snapshots, there is no persistent connection. So you only view/filter/sort the records. You can't create/edit/delete any. -- Stuart On 25 Feb 2013 at 12:10, Arthur Fuller wrote: > > What I want to do next is bind a form to the result set returned by a > Stored Procedure in the MySQL back end. > > None of the "obvious" approaches works. So now I'm thinking that what I > have to do is: > > 1. create a command object within VBA code. (Perhaps create a new > connection object, too; not sure about that yet.) > 2. Populate its attributes with procedure name, indicate that it is a SP. > 3. Add parameter objects to suit. > 4. Execute the command, assigning the result set to a recordset. > 5. Set the form's RecordSet to the recordset just created. > 6. In the form close event, close my recordset and set it to nothing. > > Does that sound about right? Have I overlooked anything? > > One thing that I do know in advance is that I'm puzzled about the parameter > objects. With some exploration I hope to clear up my haze. > > Does anyone have an example of code that does this, ideally to a non-MS SQL > database? > > TIA, > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Mon Feb 25 16:41:35 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 17:41:35 -0500 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: <512BE71F.23209.5C2E4ABA@stuart.lexacorp.com.pg> References: <512BE71F.23209.5C2E4ABA@stuart.lexacorp.com.pg> Message-ID: I'm trying to stick with you on this, Stuart, but I don't understand what you mean by "put the stored procedure in a pass-thru query. If the SP says "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM procName? That doesn't make sense. Can you please explain? TIA, Arthur On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan wrote: > You can "Bind" the recordset from a stored procedure by putting that > procedure in a > pass-trhough query and "binding" to the query > > Note the quotes around "bind". Recordset returned by SPs are snapshots, > there is no > persistent connection. So you only view/filter/sort the records. You > can't create/edit/delete > any. > > -- > Stuart > > From stuart at lexacorp.com.pg Mon Feb 25 16:58:40 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 26 Feb 2013 08:58:40 +1000 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: References: , <512BE71F.23209.5C2E4ABA@stuart.lexacorp.com.pg>, Message-ID: <512BECA0.8380.5C43CB6D@stuart.lexacorp.com.pg> You use CALL, not SELECT .... Here's a simple example: In MySQL, I run the following SQL: CREATE PROCEDURE ShowDistricts() BEGIN SELECT * FROM tblDistricts END; In Access I create a Passthrough query: In SQL view I just put: CALL ShowDistricts() and for the ODBC Connect string, I either create a suitable COnnection string or point to an existing DSN for the MySQL database. I save the query. I then create a new form and set its RecordSource to the name of that query. On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > I'm trying to stick with you on this, Stuart, but I don't understand what > you mean by "put the stored procedure in a pass-thru query. If the SP says > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM procName? > That doesn't make sense. Can you please explain? > > TIA, > Arthur > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan wrote: > > > You can "Bind" the recordset from a stored procedure by putting that > > procedure in a > > pass-trhough query and "binding" to the query > > > > Note the quotes around "bind". Recordset returned by SPs are snapshots, > > there is no > > persistent connection. So you only view/filter/sort the records. You > > can't create/edit/delete > > any. > > > > -- > > Stuart > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Mon Feb 25 18:05:00 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 19:05:00 -0500 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: <512BECA0.8380.5C43CB6D@stuart.lexacorp.com.pg> References: <512BE71F.23209.5C2E4ABA@stuart.lexacorp.com.pg> <512BECA0.8380.5C43CB6D@stuart.lexacorp.com.pg> Message-ID: Ah! Thanks so much! I hope to be off to the races now. I had no idea you could use CALL in a pass-through query. This begs a question. Assuming the SP accepts parameters, how to pass them in the CALL statement? just type them in after the SP name? Thanks, A. On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan wrote: > You use CALL, not SELECT .... > > Here's a simple example: > > In MySQL, I run the following SQL: > > CREATE PROCEDURE ShowDistricts() > BEGIN > SELECT * FROM tblDistricts > END; > > > In Access I create a Passthrough query: > > In SQL view I just put: CALL ShowDistricts() > and for the ODBC Connect string, I either create a suitable COnnection > string or point to an > existing DSN for the MySQL database. > > I save the query. I then create a new form and set its RecordSource to > the name of that > query. > > > > > On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > > > I'm trying to stick with you on this, Stuart, but I don't understand what > > you mean by "put the stored procedure in a pass-thru query. If the SP > says > > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM > procName? > > That doesn't make sense. Can you please explain? > > > > TIA, > > Arthur > > > > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan < > stuart at lexacorp.com.pg>wrote: > > > > > You can "Bind" the recordset from a stored procedure by putting that > > > procedure in a > > > pass-trhough query and "binding" to the query > > > > > > Note the quotes around "bind". Recordset returned by SPs are > snapshots, > > > there is no > > > persistent connection. So you only view/filter/sort the records. You > > > can't create/edit/delete > > > any. > > > > > > -- > > > Stuart > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr From stuart at lexacorp.com.pg Mon Feb 25 18:46:04 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 26 Feb 2013 10:46:04 +1000 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: References: , <512BECA0.8380.5C43CB6D@stuart.lexacorp.com.pg>, Message-ID: <512C05CC.11443.5CA62014@stuart.lexacorp.com.pg> Delimiter $$ Create or replace procedure ShowDistrict(DistID int) Begin Select * from tblDistricts where DistrictPK = DistID; End$$ Then: You would put: Call ShowDistrict(1) as the SQL of your passthrough query Since you can't stipulate parameters for a pass-through query, You will have to rewrite the querydef before calling.the procedure to pull the correct record.. Assume that your have bound your form to the recordsource "qryShowDistrict" and that on your display form, you have an unbound textbox txtDistrictID and a button in addition to the "bound" fields. You would do this: Private Sub CmdShowDistrict_Click() Dim qd As DAO.QueryDef Set qd = CurrentDb.QueryDefs("qryShowDistrict") qd.SQL = "CALL SHowDistrict(" & txtDistrictID & ")" Me.Requery End Sub On 25 Feb 2013 at 19:05, Arthur Fuller wrote: > Ah! Thanks so much! I hope to be off to the races now. I had no idea you > could use CALL in a pass-through query. > > This begs a question. Assuming the SP accepts parameters, how to pass them > in the CALL statement? just type them in after the SP name? > > Thanks, > A. > > > On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan wrote: > > > You use CALL, not SELECT .... > > > > Here's a simple example: > > > > In MySQL, I run the following SQL: > > > > CREATE PROCEDURE ShowDistricts() > > BEGIN > > SELECT * FROM tblDistricts > > END; > > > > > > In Access I create a Passthrough query: > > > > In SQL view I just put: CALL ShowDistricts() > > and for the ODBC Connect string, I either create a suitable COnnection > > string or point to an > > existing DSN for the MySQL database. > > > > I save the query. I then create a new form and set its RecordSource to > > the name of that > > query. > > > > > > > > > > On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > > > > > I'm trying to stick with you on this, Stuart, but I don't understand what > > > you mean by "put the stored procedure in a pass-thru query. If the SP > > says > > > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM > > procName? > > > That doesn't make sense. Can you please explain? > > > > > > TIA, > > > Arthur > > > > > > > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan < > > stuart at lexacorp.com.pg>wrote: > > > > > > > You can "Bind" the recordset from a stored procedure by putting that > > > > procedure in a > > > > pass-trhough query and "binding" to the query > > > > > > > > Note the quotes around "bind". Recordset returned by SPs are > > snapshots, > > > > there is no > > > > persistent connection. So you only view/filter/sort the records. You > > > > can't create/edit/delete > > > > any. > > > > > > > > -- > > > > Stuart > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Arthur > Cell: 647.710.1314 > > Prediction is difficult, especially of the future. > -- Niels Bohr > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Mon Feb 25 18:56:55 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 26 Feb 2013 10:56:55 +1000 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: <512C05CC.11443.5CA62014@stuart.lexacorp.com.pg> References: , , <512C05CC.11443.5CA62014@stuart.lexacorp.com.pg> Message-ID: <512C0857.23839.5CB00CE2@stuart.lexacorp.com.pg> My bad. > Create or replace procedure ShowDistrict(DistID int) That doesn't work in MySQL. Lose the "or replace". If the SP already exists, you need to DROP it first. -- Stuart On 26 Feb 2013 at 10:46, Stuart McLachlan wrote: > Delimiter $$ > Create or replace procedure ShowDistrict(DistID int) > Begin > Select * from tblDistricts where DistrictPK = DistID; > End$$ > > Then: > > You would put: Call ShowDistrict(1) > as the SQL of your passthrough query > > > Since you can't stipulate parameters for a pass-through query, You will have to rewrite the > querydef before calling.the procedure to pull the correct record.. > > Assume that your have bound your form to the recordsource "qryShowDistrict" and that on > your display form, you have an unbound textbox txtDistrictID and a button in addition to the > "bound" fields. You would do this: > > Private Sub CmdShowDistrict_Click() > Dim qd As DAO.QueryDef > Set qd = CurrentDb.QueryDefs("qryShowDistrict") > qd.SQL = "CALL SHowDistrict(" & txtDistrictID & ")" > Me.Requery > End Sub > > > > On 25 Feb 2013 at 19:05, Arthur Fuller wrote: > > > Ah! Thanks so much! I hope to be off to the races now. I had no idea you > > could use CALL in a pass-through query. > > > > This begs a question. Assuming the SP accepts parameters, how to pass them > > in the CALL statement? just type them in after the SP name? > > > > Thanks, > > A. > > > > > > On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan wrote: > > > > > You use CALL, not SELECT .... > > > > > > Here's a simple example: > > > > > > In MySQL, I run the following SQL: > > > > > > CREATE PROCEDURE ShowDistricts() > > > BEGIN > > > SELECT * FROM tblDistricts > > > END; > > > > > > > > > In Access I create a Passthrough query: > > > > > > In SQL view I just put: CALL ShowDistricts() > > > and for the ODBC Connect string, I either create a suitable COnnection > > > string or point to an > > > existing DSN for the MySQL database. > > > > > > I save the query. I then create a new form and set its RecordSource to > > > the name of that > > > query. > > > > > > > > > > > > > > > On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > > > > > > > I'm trying to stick with you on this, Stuart, but I don't understand what > > > > you mean by "put the stored procedure in a pass-thru query. If the SP > > > says > > > > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM > > > procName? > > > > That doesn't make sense. Can you please explain? > > > > > > > > TIA, > > > > Arthur > > > > > > > > > > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan < > > > stuart at lexacorp.com.pg>wrote: > > > > > > > > > You can "Bind" the recordset from a stored procedure by putting that > > > > > procedure in a > > > > > pass-trhough query and "binding" to the query > > > > > > > > > > Note the quotes around "bind". Recordset returned by SPs are > > > snapshots, > > > > > there is no > > > > > persistent connection. So you only view/filter/sort the records. You > > > > > can't create/edit/delete > > > > > any. > > > > > > > > > > -- > > > > > Stuart > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > -- > > Arthur > > Cell: 647.710.1314 > > > > Prediction is difficult, especially of the future. > > -- Niels Bohr > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Mon Feb 25 19:14:34 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 20:14:34 -0500 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: <512C0857.23839.5CB00CE2@stuart.lexacorp.com.pg> References: <512C05CC.11443.5CA62014@stuart.lexacorp.com.pg> <512C0857.23839.5CB00CE2@stuart.lexacorp.com.pg> Message-ID: So the MySQL would read: DROP PROCEDURE mySP IF EXISTS$$ CREATE PROCEDURE mySP AS etc $$ A. On Mon, Feb 25, 2013 at 7:56 PM, Stuart McLachlan wrote: > My bad. > > > Create or replace procedure ShowDistrict(DistID int) > > That doesn't work in MySQL. > > Lose the "or replace". If the SP already exists, you need to DROP it > first. > > -- > Stuart > > On 26 Feb 2013 at 10:46, Stuart McLachlan wrote: > > > Delimiter $$ > > Create or replace procedure ShowDistrict(DistID int) > > Begin > > Select * from tblDistricts where DistrictPK = DistID; > > End$$ > > > > Then: > > > > You would put: Call ShowDistrict(1) > > as the SQL of your passthrough query > > > > > > Since you can't stipulate parameters for a pass-through query, You > will have to rewrite the > > querydef before calling.the procedure to pull the correct record.. > > > > Assume that your have bound your form to the recordsource > "qryShowDistrict" and that on > > your display form, you have an unbound textbox txtDistrictID and a > button in addition to the > > "bound" fields. You would do this: > > > > Private Sub CmdShowDistrict_Click() > > Dim qd As DAO.QueryDef > > Set qd = CurrentDb.QueryDefs("qryShowDistrict") > > qd.SQL = "CALL SHowDistrict(" & txtDistrictID & ")" > > Me.Requery > > End Sub > > > > > > > > On 25 Feb 2013 at 19:05, Arthur Fuller wrote: > > > > > Ah! Thanks so much! I hope to be off to the races now. I had no idea > you > > > could use CALL in a pass-through query. > > > > > > This begs a question. Assuming the SP accepts parameters, how to pass > them > > > in the CALL statement? just type them in after the SP name? > > > > > > Thanks, > > > A. > > > > > > > > > On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan < > stuart at lexacorp.com.pg>wrote: > > > > > > > You use CALL, not SELECT .... > > > > > > > > Here's a simple example: > > > > > > > > In MySQL, I run the following SQL: > > > > > > > > CREATE PROCEDURE ShowDistricts() > > > > BEGIN > > > > SELECT * FROM tblDistricts > > > > END; > > > > > > > > > > > > In Access I create a Passthrough query: > > > > > > > > In SQL view I just put: CALL ShowDistricts() > > > > and for the ODBC Connect string, I either create a suitable > COnnection > > > > string or point to an > > > > existing DSN for the MySQL database. > > > > > > > > I save the query. I then create a new form and set its > RecordSource to > > > > the name of that > > > > query. > > > > > > > > > > > > > > > > > > > > On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > > > > > > > > > I'm trying to stick with you on this, Stuart, but I don't > understand what > > > > > you mean by "put the stored procedure in a pass-thru query. If the > SP > > > > says > > > > > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM > > > > procName? > > > > > That doesn't make sense. Can you please explain? > > > > > > > > > > TIA, > > > > > Arthur > > > > > > > > > > > > > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan < > > > > stuart at lexacorp.com.pg>wrote: > > > > > > > > > > > You can "Bind" the recordset from a stored procedure by putting > that > > > > > > procedure in a > > > > > > pass-trhough query and "binding" to the query > > > > > > > > > > > > Note the quotes around "bind". Recordset returned by SPs are > > > > snapshots, > > > > > > there is no > > > > > > persistent connection. So you only view/filter/sort the > records. You > > > > > > can't create/edit/delete > > > > > > any. > > > > > > > > > > > > -- > > > > > > Stuart > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > dba-SQLServer mailing list > > > > > dba-SQLServer at databaseadvisors.com > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > -- > > > Arthur > > > Cell: 647.710.1314 > > > > > > Prediction is difficult, especially of the future. > > > -- Niels Bohr > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr From fuller.artful at gmail.com Mon Feb 25 19:15:01 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 20:15:01 -0500 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: <512C05CC.11443.5CA62014@stuart.lexacorp.com.pg> References: <512BECA0.8380.5C43CB6D@stuart.lexacorp.com.pg> <512C05CC.11443.5CA62014@stuart.lexacorp.com.pg> Message-ID: Wow. Very interesting. I'm off to the lab to get my typing fingers dirty! Thanks. A. On Mon, Feb 25, 2013 at 7:46 PM, Stuart McLachlan wrote: > Delimiter $$ > Create or replace procedure ShowDistrict(DistID int) > Begin > Select * from tblDistricts where DistrictPK = DistID; > End$$ > > Then: > > You would put: Call ShowDistrict(1) > as the SQL of your passthrough query > > > Since you can't stipulate parameters for a pass-through query, You will > have to rewrite the > querydef before calling.the procedure to pull the correct record.. > > Assume that your have bound your form to the recordsource > "qryShowDistrict" and that on > your display form, you have an unbound textbox txtDistrictID and a button > in addition to the > "bound" fields. You would do this: > > Private Sub CmdShowDistrict_Click() > Dim qd As DAO.QueryDef > Set qd = CurrentDb.QueryDefs("qryShowDistrict") > qd.SQL = "CALL SHowDistrict(" & txtDistrictID & ")" > Me.Requery > End Sub > > > > On 25 Feb 2013 at 19:05, Arthur Fuller wrote: > > > Ah! Thanks so much! I hope to be off to the races now. I had no idea you > > could use CALL in a pass-through query. > > > > This begs a question. Assuming the SP accepts parameters, how to pass > them > > in the CALL statement? just type them in after the SP name? > > > > Thanks, > > A. > > > > > > On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan < > stuart at lexacorp.com.pg>wrote: > > > > > You use CALL, not SELECT .... > > > > > > Here's a simple example: > > > > > > In MySQL, I run the following SQL: > > > > > > CREATE PROCEDURE ShowDistricts() > > > BEGIN > > > SELECT * FROM tblDistricts > > > END; > > > > > > > > > In Access I create a Passthrough query: > > > > > > In SQL view I just put: CALL ShowDistricts() > > > and for the ODBC Connect string, I either create a suitable COnnection > > > string or point to an > > > existing DSN for the MySQL database. > > > > > > I save the query. I then create a new form and set its RecordSource > to > > > the name of that > > > query. > > > > > > > > > > > > > > > On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > > > > > > > I'm trying to stick with you on this, Stuart, but I don't understand > what > > > > you mean by "put the stored procedure in a pass-thru query. If the SP > > > says > > > > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM > > > procName? > > > > That doesn't make sense. Can you please explain? > > > > > > > > TIA, > > > > Arthur > > > > > > > > > > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan < > > > stuart at lexacorp.com.pg>wrote: > > > > > > > > > You can "Bind" the recordset from a stored procedure by putting > that > > > > > procedure in a > > > > > pass-trhough query and "binding" to the query > > > > > > > > > > Note the quotes around "bind". Recordset returned by SPs are > > > snapshots, > > > > > there is no > > > > > persistent connection. So you only view/filter/sort the records. > You > > > > > can't create/edit/delete > > > > > any. > > > > > > > > > > -- > > > > > Stuart > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > -- > > Arthur > > Cell: 647.710.1314 > > > > Prediction is difficult, especially of the future. > > -- Niels Bohr > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Arthur Cell: 647.710.1314 Prediction is difficult, especially of the future. -- Niels Bohr From stuart at lexacorp.com.pg Mon Feb 25 19:26:36 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 26 Feb 2013 11:26:36 +1000 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: References: , <512C0857.23839.5CB00CE2@stuart.lexacorp.com.pg>, Message-ID: <512C0F4C.24483.5CCB3BB0@stuart.lexacorp.com.pg> Don't use AS - that's MS TSQL. DROP PROCEDURE IF EXISTS mySP$$ CREATE PROCEDURE mySP BEGIN ... END$$ On 25 Feb 2013 at 20:14, Arthur Fuller wrote: > So the MySQL would read: > > DROP PROCEDURE mySP IF EXISTS$$ > CREATE PROCEDURE mySP > AS > etc > $$ > > A. > > > On Mon, Feb 25, 2013 at 7:56 PM, Stuart McLachlan wrote: > > > My bad. > > > > > Create or replace procedure ShowDistrict(DistID int) > > > > That doesn't work in MySQL. > > > > Lose the "or replace". If the SP already exists, you need to DROP it > > first. > > > > -- > > Stuart > > > > On 26 Feb 2013 at 10:46, Stuart McLachlan wrote: > > > > > Delimiter $$ > > > Create or replace procedure ShowDistrict(DistID int) > > > Begin > > > Select * from tblDistricts where DistrictPK = DistID; > > > End$$ > > > > > > Then: > > > > > > You would put: Call ShowDistrict(1) > > > as the SQL of your passthrough query > > > > > > > > > Since you can't stipulate parameters for a pass-through query, You > > will have to rewrite the > > > querydef before calling.the procedure to pull the correct record.. > > > > > > Assume that your have bound your form to the recordsource > > "qryShowDistrict" and that on > > > your display form, you have an unbound textbox txtDistrictID and a > > button in addition to the > > > "bound" fields. You would do this: > > > > > > Private Sub CmdShowDistrict_Click() > > > Dim qd As DAO.QueryDef > > > Set qd = CurrentDb.QueryDefs("qryShowDistrict") > > > qd.SQL = "CALL SHowDistrict(" & txtDistrictID & ")" > > > Me.Requery > > > End Sub > > > > > > > > > > > > On 25 Feb 2013 at 19:05, Arthur Fuller wrote: > > > > > > > Ah! Thanks so much! I hope to be off to the races now. I had no idea > > you > > > > could use CALL in a pass-through query. > > > > > > > > This begs a question. Assuming the SP accepts parameters, how to pass > > them > > > > in the CALL statement? just type them in after the SP name? > > > > > > > > Thanks, > > > > A. > > > > > > > > > > > > On Mon, Feb 25, 2013 at 5:58 PM, Stuart McLachlan < > > stuart at lexacorp.com.pg>wrote: > > > > > > > > > You use CALL, not SELECT .... > > > > > > > > > > Here's a simple example: > > > > > > > > > > In MySQL, I run the following SQL: > > > > > > > > > > CREATE PROCEDURE ShowDistricts() > > > > > BEGIN > > > > > SELECT * FROM tblDistricts > > > > > END; > > > > > > > > > > > > > > > In Access I create a Passthrough query: > > > > > > > > > > In SQL view I just put: CALL ShowDistricts() > > > > > and for the ODBC Connect string, I either create a suitable > > COnnection > > > > > string or point to an > > > > > existing DSN for the MySQL database. > > > > > > > > > > I save the query. I then create a new form and set its > > RecordSource to > > > > > the name of that > > > > > query. > > > > > > > > > > > > > > > > > > > > > > > > > On 25 Feb 2013 at 17:41, Arthur Fuller wrote: > > > > > > > > > > > I'm trying to stick with you on this, Stuart, but I don't > > understand what > > > > > > you mean by "put the stored procedure in a pass-thru query. If the > > SP > > > > > says > > > > > > "SELECT * FROM someTables" then how do I "put it in"? SELECT FROM > > > > > procName? > > > > > > That doesn't make sense. Can you please explain? > > > > > > > > > > > > TIA, > > > > > > Arthur > > > > > > > > > > > > > > > > > > On Mon, Feb 25, 2013 at 5:35 PM, Stuart McLachlan < > > > > > stuart at lexacorp.com.pg>wrote: > > > > > > > > > > > > > You can "Bind" the recordset from a stored procedure by putting > > that > > > > > > > procedure in a > > > > > > > pass-trhough query and "binding" to the query > > > > > > > > > > > > > > Note the quotes around "bind". Recordset returned by SPs are > > > > > snapshots, > > > > > > > there is no > > > > > > > persistent connection. So you only view/filter/sort the > > records. You > > > > > > > can't create/edit/delete > > > > > > > any. > > > > > > > > > > > > > > -- > > > > > > > Stuart > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > dba-SQLServer mailing list > > > > > > dba-SQLServer at databaseadvisors.com > > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > dba-SQLServer mailing list > > > > > dba-SQLServer at databaseadvisors.com > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > > > -- > > > > Arthur > > > > Cell: 647.710.1314 > > > > > > > > Prediction is difficult, especially of the future. > > > > -- Niels Bohr > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Arthur > Cell: 647.710.1314 > > Prediction is difficult, especially of the future. > -- Niels Bohr > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Mon Feb 25 19:51:05 2013 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 25 Feb 2013 20:51:05 -0500 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: <512C0F4C.24483.5CCB3BB0@stuart.lexacorp.com.pg> References: <512C0857.23839.5CB00CE2@stuart.lexacorp.com.pg> <512C0F4C.24483.5CCB3BB0@stuart.lexacorp.com.pg> Message-ID: I keep forgetting which language I'm speaking. I have the same problem switching from Spanish to Italian. A. On Mon, Feb 25, 2013 at 8:26 PM, Stuart McLachlan wrote: > Don't use AS - that's MS TSQL. > > DROP PROCEDURE IF EXISTS mySP$$ > CREATE PROCEDURE mySP > BEGIN > ... > END$$ > > From stuart at lexacorp.com.pg Mon Feb 25 20:41:46 2013 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 26 Feb 2013 12:41:46 +1000 Subject: [dba-SQLServer] MySQL not MS SQL question In-Reply-To: References: , <512C0F4C.24483.5CCB3BB0@stuart.lexacorp.com.pg>, Message-ID: <512C20EA.26944.5D100CF4@stuart.lexacorp.com.pg> I'm currently trying to brush up on my schoolboy French from 50 years ago since I'm probably going with the PNG Sailing team to Wallis & Futuna later this year for the Mini-Pacific Games. I keep getting bits Malay and Pidgin mixed up in with it. :-) -- Stuart On 25 Feb 2013 at 20:51, Arthur Fuller wrote: > I keep forgetting which language I'm speaking. I have the same problem > switching from Spanish to Italian. > > A. > > > On Mon, Feb 25, 2013 at 8:26 PM, Stuart McLachlan wrote: > > > Don't use AS - that's MS TSQL. > > > > DROP PROCEDURE IF EXISTS mySP$$ > > CREATE PROCEDURE mySP > > BEGIN > > ... > > END$$ > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > >