I hope someone can help me in this problem. I create the Procedure to generate the dynamic SQL statement, and execute the dynamic SQL at end of the Procedure. When I done in Server Management Studio, all thing is OK, return me the record.
"pRecordSet" is an ADO recordset. The database column "MyColumn" is of type "decimal(19,10)".
The most important question for me is, if the regional settings of the database server or the regional settings of the client PC are considered during the conversion from the string to the decimal value. For example in standard French regional settings the "." would not be recognized as decimal separator.
I am also wondering if the language of the database instance, in which this data is saved, is considered during this conversion or any other settings of this database instance.
So my general question is: Does anybody know exactly what rules apply during the above mentioned conversion?
I want to transfer a recordset (derived from an Oracle datasource) into an SQL2000 Server table using VBScript in a ActiveX Script Task using a DTS.
Currently I use the OPENROWSET (and OPENQUERY) method, however the lenght of the querytext seems to be limited to 8192 bytes. At this moment I have reached the limit of this lenght, and I am looking for a solution.
Futher info: The query returns large recordsets of 100,000s of records with 100s of columns. Because of it's complex structure, the standard data transformation in SLQ2000 is not an option.
Using a substitute like:
varRecords = rst1.GetRows For intI = 0 To UBound(varRecords, 2) rst2.AddNew For intJ = 0 To UBound(varRecords, 1) rst2(intJ) = varRecords(intJ, intI) Next Next rst2.Update
I have two dbs with the same table names and fields but different data. My connection is right, as well as my query. How come that my program can't access the data from one table while the there's no problem with the another one? My recordset is empty even the record I'm searching for exists. It's rs.recordcount is -1. Is that database corrupted?
Is there a way to return just the raw data from a report? I do not mean XML rending which marries the dataset information with the layout information. I just want the raw data from the dataset. If the XML returned was the result of the recordset from the de-parameteraized query only that would be great!
I am looking into writing a Custom Rendering Extension, but I am not fining much outside of the same MS example circulating. It seems to only deal with layout data and not the raw dataset data.
Is there way to get to just the raw data and ignore layout? Is the dataset in the SSRS Temp Dd that you can query after a report has run? If anyone knows of any way to get to the raw data that would be fantastic.
I have been using a recordset destination in a data flow where I need to perform some complex manipulation on a dataset, including combining some information from a web service and updating records that already exist, vs. inserting them.
I have a script task that modifies the dataset as needed, and then saves it back to the variable it came from.
However, when it comes time to write the data to the database, I couldn't find an appropriate tool - there's no "recordset source" object in the data flow task, and use of a "for each" loop with a sql call to a stored proc takes 20 minutes for a few thousand rows.
The best way I could find around this was as follows:
Call the .NET ".GetXML" method on the dataset and put the resulting XML data into a string variable Generate an XSD for that XML (it comes out like <NewDataSet><Table1>...) Use an XML source in the data flow task.This works, and the same data insert that took 20 minutes via the loop / stored procs now takes under 10 seconds.
It seems horribly inefficient to have to do this - there should be a way to just dump my dataset back into a table natively without all that extra stuff.
I'm new on this forum, but, I'm a experienced programmer. I wanna solve this problem (if you can helpme....), recently, I'm trying to migrate an old SQL 7 to the new SQL 2005 server enterprise edition, I have no problem to import the data, users, stored procedures, etc. and all work fine, I can connect troght ODBC from the others computers, including some older pentium 1 mmx 200 mhz. with WIN98 (yes!).
My problem is an legacy VB6 application that work (well fine) with SQL7 server, but, when i change the odbc of the desktops systems to the new 2005 SQL server and run this legacy application hi recibe this error: (english translation from spanish language)
[ODBC SQL Server Driver][SQL Server] The table to be modified is not included on this cursor or these can't be modified throught this cursor.
I have look on the source code of the legacy application, and someone of the segment's that causes error is:
Public Function ConsultaCamara(sRutOP As String, _ sRut1 As String, _ strConsulta As String, _ Tipo As String, _ chk As CheckBox, _ Timer1 As Timer, _ LbAviso As Label) As Long '---------------------------- Dim rsCACH, rsCACH_upd0, rsCACH_upd1, rsCACH_upd2 As ADODB.Recordset Dim CmCACH As ADODB.Command Dim lPendiente As Boolean Dim lActivo As Boolean Dim strSQL1, strSQL_upd0, strSQL_upd1, strSQL_upd2 As String Dim StrWHE As String Dim DameTiempo As Integer Dim snombre As String Dim sMsgEstado As String Dim sAviso_Inicial As String Dim cNum As String Dim cDig As String ... ... ... 'Defino el string de consulta strSQL1 = " SELECT RUTOPERADOR, " & _ " IDCAMARA, " & _ " RUTCONSULTADO, " & _ " ESTADO, " & _ " CANCON, " & _ " CADENACONSULTA, " & _ " FINGRESO, " & _ " FULCONSINT, " & _ " ULTRUTOP " & _ " FROM BOLETIN " & _ " WHERE RUTCONSULTADO = '" & sRut1 & "'" & _ " AND (ESTADO = 'PE' OR ESTADO = 'AC' )"
Set rsCACH = CreateObject("ADODB.Recordset") rsCACH.ActiveConnection = cn rsCACH.CursorType = adOpenKeyset rsCACH.LockType = adLockOptimistic rsCACH.Open strSQL1 If rsCACH.EOF Then 'No hay registro antiguo o en consulta, creo uno para consultar sMsgEstado = "NO Existen datos ES REGISTRO NUEVO" & vbCr rsCACH.AddNew ConsultaCamara = GeneraID() rsCACH.Fields("IDCAMARA") = ConsultaCamara rsCACH.Fields("RUTOPERADOR") = sRutOP rsCACH.Fields("RUTCONSULTADO") = sRut1 rsCACH.Fields("ESTADO") = "PE" rsCACH.Fields("CANCON") = 1 rsCACH.Fields("CADENACONSULTA") = strConsulta rsCACH.Fields("FINGRESO") = GetDateTime() 'Format(Date, "Short Date") rsCACH.Fields("FULCONSINT") = GetDateTime() 'Format(Date, "Short Date") rsCACH.Fields("ULTRUTOP") = sRutOP rsCACH.Update <----- here's launches the error ... ... ...
I am having a problem writing a large amount of ntext data to a field within an ADO recordset. I am using the append chunk method but it does not seem to work. The SQL 7 field will hold the data its only about 60K.
I am new to this forum so I am not sure if this is posted in the appropriate group.
Okay - this may be a silly question - what is a crosslink table? Is this easily achieved in the MySQL query browser? Here is some more details on what I am trying to achieve. I have seen it done but not sure where to start....
The products correspond as follows:
- To be eligible for 'product a' the buyer must meet two qualifications:
1. Specify their 'model of their engine.' 2. Specify the 'year' of their engine.
Is there a way to structure my tables so that if a person specifies 'a specific year' and 'specific model' the correct product A, B, or C will pull up for them?
Do I create separate tables named 'Engine Model' and 'Engine Year' -- and then link to the product table with foreign keys? If so, how do I specify more than one grouping. For example product A is compatible with 2004-2007 engines and 10 different engine models.
I am new to mySql -- but a quick study -- hopefully this is easy to implement.
Hi there, I need to develop a module and wondering what would be the best implementation...
I get a list of files from a text file and store it in a Recordset Destination (object variable "CUST_INV_LIST").
I need to check that all the files in a directory are in the list. I can loop through the files in the directory using a ForEach container, but how do I check if it is in the CUST_INV_LIST recordset?
I thought about using another ForEach container to loop through the recordset, check if the physical file is equal to that row, if so set a flag, ... but it's neither elegant nor effective.
Another option would be to use a Script Task to search for the physical file name in the recordset. I tried with the Data.OleDb.OleDbDataAdapter, etc. but I get and error when I declare Data.DataTable. Anyways that method of accessing a recordset is not recommanded and seems complicated.
we have a application written in straight ASP, we recently upgraded our SQL database connecting to the application from SQL 2000 to 2005 here is the issue
currently SQL 2005 is located in our test and UAT environments, SQL 2005 is not clustered in either location. Now let me make it clear THIS PROBLEM IS NOT HAPPENING IN OUR TEST ENVIRONMENT, I REPEAT THIS PROBLEM IS NOT HAPPENING IN OUR TEST ENVIROMENT, THIS PROBLEM IS ONLY HAPPENING IN OUR UAT ENVIROMENT
Each enviroment is outfitted with the following SQL 2005 environment, Enterprise Edition SP1 with Cumlative hotfix package 2153 just the SISS fix ONLY
now the problem is this, we have a vb program located directly on the server that has SQL 2005 on it that VB program inserts a timestamp into a table inside the database, now how this happens is the program connects to the database and opens a recordset with a forwardonly cursor and inserts the timestamp
NOW THE EXACT PROBLEM IS THAT THE VB PROGRAM CANNOT OPEN MULTIPLE RECORDSETS, THE ERROR RECEIVED IS LABLED LIKE THIS
NOW here is the interesting part, AGAIN THIS IS NOT HAPPENING IN OUR TEST ENVIRONMENT, THE VB PROGRAM AGAIN IS ON THE TEST SQL SERVER AND HAS A FORWARD ONLY CURSOR AND INSERTS JUST FINE
NOW IF I MOVE THE VB PROGRAM OUT OF OUR UAT ENVIRONMENT ONTO ANOTHER SERVER IT INSERTS THE RECORD ONTO SQL SERVER JUST FINE, IT OPENS THE RECORDSET AND OPERATES NORMALLY, BOTH SERVERS HAVE EXACT SAME PERMISSIONS
Can anyone help me understand whats happening here
One note, when we changed the cursortype from forward-only to keyset it worked fine but that doesnt explain things
why does it work in test so clearly what we did with changing the cursortype isnt the answer
I have an update query in an OLE DB Destination (access mode: SQL Command) that updates a table with an INNER JOIN from another table in another database. I'm getting the error, "No disconnected recordset available for the specified SQL statement". Does this have to do with the SQL query trying to access the other database? How can I get around this error?
Te first record of a Recordest obtained from a Command Object executing a Stored Procedure, doesn't show the first record when I asociate this to a data report.(VB6 - SQL7) (ADO 2.1)
If I execute the stored procedure directly from query analizer, I have obtained the right resultset.
I'm running the following SQL query from LabVIEW, a graphical programming language, using the built in capabilities it has for database connectivity:
   DECLARE @currentID int    SET @currentID = (SELECT MIN(ExperimentID) FROM Jobs_t WHERE JobStatus = 'ToRun');    UPDATE [dbo].[Jobs_t]    SET [JobStatus] = 'Pending'    WHERE ExperimentID = @currentID;    SELECT @currentID AS result <main.img>
This is the analogous code to main() is a C-like language. The first block, which has the "Connection Information" wire going into it, opens a .udl file and creates an ADO.NET _Connection reference, which is later used to invoke methods for the query.
<execute query.img>
This is the inside of the second block, the one with "EXE" and the pink wire going into it. The boxes with the gray border operate much like "switch" statements. The wire going into the "?" terminal on these boxes determines which case gets executed. The yellow boxes with white rectangels dropping down are invoke nodes and property nodes; they accept a reference to an object and allow you to invoke methods and read/write properties of that object. You can see the _Recordset object here as well. <fetch recordset.img>
Here's the next block to be executed, the one whose icon reads "FETCH ALL". We see that the first thing to execute on the far left grabs some properties of the recordset, and returns them in a "struct" (the pink wire that goes into the box that reads "state"). This is where the code fails. The recordset opened in the previous VI (virtual instrument) has a status of "closed", and the purple variant (seen under "Read all the data available") comes back empty.
The rest of the code is fairly irrelevant, as it's just converting the received variant into usable data, and freeing the recordset reference opened previously. My question is, why would the status from the query of the recordset be "closed"? I realize that recordsets are "closed" when the query returns no rows, but executing that query in SSMS returns good data. Also, executing the LabVIEW code does the UPDATE in the query, so I know that's not broken either.
The application is running ADO (MDAC) version 2.81.1117.0.
The application gets an recordset created by SQLServer by an select statement. In this case the recordset is empty.
The application adds a record to the recordset by AddNew(). Works fine. But when assigning the first field (smalldatetime in database) I get ADO error -2147217887.
I have inspected the recordset and I found a difference between the working one from SQLServer2000 and the new one from SQLServer2005: The Attributes item for the fields in the recordset has the flag adFldUnknownUpdatable set in the working SQL2000 version but is not set from SQL2005.
The database on SQL2005 is copied from the SQL2000 system and attatched to the SQL2005 system. I Have checket that the compability flag for the database on the SQL2005 system is set to SQL2000 compability.
Hi, I am trying to cycle through a table and trigger an event based on some critera. I am not sure how to do it. I am a classic VBA guy, so I might be way off: Dim myConnection As SqlConnection Dim myCommand As SqlCommand myConnection = New SqlConnection("MY SQL DATA SOURCE") myConnection.Open()
myCommand = New SqlCommand("SELECT * FROM history", myConnection) Dim dr = myCommand.ExecuteReader() Dim i As Integer = 1
While dr.read() i = i + 1 ' HOW DO I CYCLE THROUGH THE ROWS AND ASK IF A FIELD EQUALS A VALUE ' field name = "Tail"
hi I have 3 tables:Article,Source and File. Each article can have multiple filenames. The fields of table Article are:ArticleID,SourceID,ArticleDate,ArticleCategory The fields of table Source are:SourceID,SourceName the fields of Table File:ID,ArticleID,Filename Select*from Article inner join Source on Article.SourceID=source.SourceID order by ArticleDate I obtain a number of recordsets from the above query. Then for each recordset(Rs1),Let's say for the first recordset Rs1.MoveFirst I want to apply this query: Rs2.Open"Select SourceName,ArticleDate,File.Filename from [RS1] inner Join File on Article.ArticleID=File.ArticleID I want from the above query to have the Filenames corresponding to each Article because in my VB form I have 2 command buttons:one gives me the article's definition(Date,Source) and the other gives me the Filename of the current recordset(Article) The above SQL syntax is it correct?
SELECT TOP 2 MenuComments, MenuDate, MenuID, MenuIsActive, MenuName FROM Menu ORDER BY MenuDate DESC
This orders the data correctly, but the problem is, I need ONLY the SECOND row, not the top row. Also, because I am sorting for menus entered into the system, I cannot use a variable based on real dates (in other words, I can't use the server clock to help filter the results).
Any and all help would be GREATLY appreciated -- I've been banging my head against this one all day!
I am using classic ASP. Records are grouped together by a GroupUnique number. Some groups are small with about 10 records, othere are larger at about 160.
For each record, I have about 50 columns of data that I need to display on a webpage. Because the 50 columns don't easily fit on the one page, I create two tables, each displaying 26 columns, the first columnn being an ID column. Due to the size of groups, sometimes the tables are very large - and when they get too big it overloads the server.
I think the main problem is the two tables. I use two recordsets (one of them is shown below - although instead of a SELECT * I do in fact name the columns needed for each table). I have to use two because the Recordsets don't like me using the ID column again - once it is used it is gone.
Is there a better way to store all of this information so that I can just use the one recordset? Possibly in an array? Is there a more efficient way of getting the data?
<% Dim Recordset4__MMColParam1 Recordset4__MMColParam1 = "1" If (Scramble.Fields.Item("GU").Value <> "") Then Recordset4__MMColParam1 = Scramble.Fields.Item("GU").Value End If %>
I am having some problems. I'm pretty new to sql and really dont know how to achieve more than the basic selects etc.,
My problem is that I have a recordset on one page http://www.photoghetto.com/photo-images/animals.asp that returns the results of all the images in one category. In this case it's animals and wildlife.
The user can click on any image and go to a page that shows a larger detail version of the image. http://www.photoghetto.com/photo-images/animals-photo-detail.asp
What I do is post the ProductID number to this page so that the selected thumb is shown. So for exmaple for the image of the wild cat it is http://www.photoghetto.com/photo-images/animals-photo-detail.asp?ProductID=6
My problem is that on the animals-photo-detail.asp the user has to be able to "scroll" through all the images from the category.
I.e should be able to hit the previous image button and see the stallion image, or the next button to see the butterfly etc., and thus scroll through all the images on this age if he/ she wishes to.
I understand the principles of having a results page and then being able to click on one of the results and getting a detail page. Such as I have it here. With the http://www.photoghetto.com/photo-images/animals.asp as a results page listing all the results of the category, and then when the user clicks on one of the results, goes to a detail page, for example, http://www.photoghetto.com/photo-images/animals-photo-detail.asp?ProductID=6.
My problem is that what I need is the recordset from the listing page to function on the detail page so that the user can scroll through the results in the same order that they were on the results page.
I have searched now for a couple of days online and every tutorial I find shows the same structure. Results Page > Detail Page.
The sql i am using on the detail page is simply,
<% Dim photos_rs__MMColParam photos_rs__MMColParam = "1" If (Request.QueryString("ProductID") <> "") Then photos_rs__MMColParam = Request.QueryString("ProductID") End If %>
So I understand why it will only display the one result since thats the detail page.
Is it possible to be able to scroll through the results using the previous and next buttons as I have setup in the display on the http://www.photoghetto.com/photo-images/animals-photo-detail.asp page. For example, http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=6.
Since the resutls are gathered from across the database its not possible to have a href tage that does a <<< http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=(6 -1) or a >>> http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=(6+1).
I guess it has to be something with a recordset index but does anyone know how to do it? And does anyone have the ability to help me do it?
My boss is kicking my butt now to get this thing online at some point today, and I'm turning to you guys for help if possible.
I'm sorry if this is a stupid question. I've really ran out of ideas.
This asp code displayes records in a combo box:<%openDB()call updateDB("usp_retrieveOptions",rs)if not rs.eof then%><tr><td width="66">Options</td><td width="137"><select name="select1" class="TextField1"><%i = 0do while not rs.eofif rs(0) <> Arr(i) thenresponse.write "<option value=" & rs(0) & ">" & rs(1)i = i + 1end ifrs.movenextloop%></select></td></tr><tr><td colspan="2" width="206"><center><table width="71" border="0" cellspacing="3" cellpadding="0"height="33"><tr><td width="9" height="30"><input type="submit" name="Assign" value="Assign"></td></tr></table></center></td></tr><%end ifcloseRS()closeDB()%>The call updateDB("usp_retrieveOptions",rs) invokessub updateDB(SQL,rs)set rs = objConn.Execute(SQL)end suband my usp_retrieveOptions stored procedure:create procedure usp_retrieveOptionsAS SET NOCOUNT ONSELECT OptionID, Description FROM OptionsReturnGOnow in my asp code when I try response.write rs.RecordCount I am getting-1 all the time. How do I solve the problem. Your help is kindlyappreciated.Eugene Anthony*** Sent via Developersdex http://www.developersdex.com ***
Im doing a select that should retrieve a name from one table and display thenumber of correct bets done in the betDB (using the gameDB that has info onhow a game ended)I want the "MyVAR" value to be used in the inner select statement withouttoo much hassle. As you can see im trying to get the "MyVAR" to insert inthe bottom line of the code.Whats the quick fix to this one..?Thanks in advance :-)---------- code begin ----------select memberDB.memberID as MyVAR, (select count(GamesDB.GameID)from GamesDBinner join GameBetDBon GameBetDB.betHome = GamesDB.homeGoal and GameBetDB.betAway =GamesDB.awaygoalinner join memberDBon memberDB.memberID = GameBetDB.memberIDwhere GamesDB.gameID=GameBetDB.gameIDand GameBetDB.memberID= MyVAR ) as wins from memberDB---------- code end ----------
I am connecting to the database as following: set con = server.createobject("adodb.connection") con.open "connectionstring" set rs = con.execute("select * from tablename")
I am able to display the records but if I want to give adopenstatic to the above connection, how can I do so?
I have some problems to edit a recordset in an ActiveX DTS using Vbscript. Here is an example of the script :
dim varsql, varset, varconn set varconn = CreateObject("ADODB.Connection") set varset = CreateObject("ADODB.Recordset") varconn.Open = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=Enregistrement3;user id = 'sa';password=''"
if varset.recordcount >0 then do while varset.eof varset.edit ......................... varset.update varset.movenext loop end if varset.close varconn.close
Does someone see what is wrong ? I allways get -1 for the varset.recordcount ! (I checked there are some records into the table). I don't think it is a problem of user's right as it works with the same user configuration using a SQL action requery. If I modify the open statement like this : varset.Open varsql, varconn, 1 varset.recordcount contains the good number of records but the recordset is read noly and can't be modified...
<!--- Update the DISTANCE field on STORE table ---> <cfquery name="UpdateZips" datasource="#application.data#" username="#application.username#" password="#application.password#"> exec Stores_UpdateZipSeachInfo '#Dist#', '#zip2.zipcode#' </cfquery> </cfloop>
I'm an SQL novice, but I know this must be a common problem.
I'm trying to select a recordset (using ASP), but I know I only want part of the recordset, and am not sure how to limit it ahead of time.
For example, the query will return about 500 rows, but I know I only want to use a small section of these records. I want to give the user the ability to navigate through small sections of these 500 rows without having to get all rows all the time. I know ahead of time which rows to get, but have no idea how to limit the recordset before I get it (there is no fields in the database to help).
This is what I'm doing now. "select * from xyz where id=xxx order by date desc;" I know I only want the first 10, or 10-20, or 400-410. The way I'm doing it now, I'm getting the whole recordset each time, doing a "rs.move x" where x is where I want to start. This is really a waste of network traffic and memory since my SQL server is on a different machine as the web server running ASP.
How do I do this?
Please email me if you could at pmt@vantagenet.com