|
Hi Werries
Your problem lays with the way that you are opening your recordset, rather than with the stored procedure. ADO is using the "adOpenForwardOnly" cursor-type in your second example. Try:
rsRecord.Open "[dbo].[FetchCustomers]", cnDatabase, adOpenKeyset, adLockReadOnly, adCmdStoredProcedure There are several other overloads for the Open method, including one that allows you to open the recordset from a command object.
Regards
Andy
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
Hi Andy,
Maybe I must rephrase my problem and question. I wànt to use a stored procedure to fetch the information, but the way I retrieve the recordsets does not allow me to scroll the records in the recordset. I need to be able to set the absolute position of the recordset and then fetch records from there. If I use a SQL command to retrieve the recordset like in my first attempt, I can set the absolute position of the recordset, but if I retrieve a recordset through a stored procedure the recordset does not allow me to set the absolute position on it. It raises an error 3251, ‘Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.’ If I can change the cursortype when using a stored procedute that supports bookmarks it will be great.
I hope I have explained myself better this time. Thanks for your previous reply on this matter. Any other suggestions?
Thanks, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
I went back and modified my original reply to invoke your stored procedure. Your problem was caused by ADO using its default forward-only cursor type, rather than the keyset cursor type that you were originally using with your SQL select.
|
|
|
|
|
Hi Andy,
I did see your modification on your first reply and applied it to my code, but it seems to me I still have a forward-only cursor type. When I'm trying to set the absolute position of the recordset the same error occurs 'Current Recordset does not support bookmarks....'
I still don’t have a solution for my problem, but I'm thinking of trying a whole different way of implementing what I actually want to do. But if you've got a solution of why the recordset still have a forward-only cursor type, I’ll be glad to hear it from you. I appreciate all your help.
Have a nice weekend,
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
Hi Werries
If ADO doesn't think that a requested cursor-type is possible then it silently changes to another type.
I don't normally use bookmarks - so its not something that I have a problem with. I normally use GetRows() to grab the recordset's contents into a 2-dimensional array. This allows me to close the recordset and grab any output parameters.
Have a good weekend.
Regards
Andy
PS: Have you set "Set nocount on" in the stored procedure?
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
I have a application build around VB6 for windows, I want to change that application to VB .NET to run for Win CE. Can I do with the migration procedure?Or by any other means?
Thanx in advance...
birajendu
CyberG India
Delhi
India
|
|
|
|
|
You basically have to do it by hand, they are very different languages.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
I want to connect a crystal Report dynamically with database which changes accordingly but the table is same in all the database table name = “Stock “ Also I want to add condition
“SELECT * FROM Stock Where Date BETWEEN ‘xyz’ AND ‘abc’” Database is used by me is ACCESS.
Any one help me. Thanks in advance.
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
What is exactly is your problem? You described what you were doing, but didn't really say what the problem is, thus can't really help you until you give better detail to the problem.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
just give the logic or code for the dynamic connection with crystal report
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
Er nikesh yadav wrote: just give the logic or code for the dynamic connection with crystal report
Nope. I don't work like that. The code I develop costs a substantial amount money and I only offer advise, not code.
Here is advice for the dynamic connection, assuming you have a connection string already setup, you can change them at runtime. I don't see any really descriptive problem here.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
sorry i forgot the please but i rally thank ful to you if u can explain some more i already tried your suggestion it doen't work please help me
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
Er nikesh yadav wrote: sorry i forgot the please
Don't worry about it, bro. I am just getting tired and cranky
But do look up readings on Crystal Reports, even visit their site, they may have white papers to help you.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
thanks
Nikesh Kr. Yadav
CSS Infotech
Sec- 31
Gurgaon,
Haryana(India)
|
|
|
|
|
I suggest you read up on how to ask questions. I can guarentee you that the advice you've been given, works. So, if you can't work out how to do it, try posting code and explaining what is going wrong, so we can help you to follow the advice you've been given.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
On a kinder note, I recommend you find some good literature on Crystal Reports since it seems you are asking alot of questions about it lately.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Looking at your message history, you post every question you have to at least three forums. Please don't do that, it's rude and annoying. Pick the right forum and ask there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: it's rude and annoying
I've already scolded a little bit on leckey's behalf
He's sounds like he's demanding just give the logic or code for the dynamic connection with crystal report, well, no real quick and easy answer, and he forgot to say please :->
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
How can I caputre the content in the IE Address bar ofthe current IE Window?
If there is a different way maybe a ie hook? Ref: http://www.codeproject.com/shell/iesaveas.asp[^]
All sugestions are welcome.
My code retrives the handle of the active window but i need to strip information from specific a object within a window. Like the IE Address bar. Here is the code I have.
Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Integer
Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" (ByVal hwnd As Integer) As Integer
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' Get the window's handle.
Dim fg_hwnd As Long = GetForegroundWindow()
Dim pid As Integer = 3528 ' "2940" '
GetWindowThreadProcessId(fg_hwnd, pid)
Debug.WriteLine("HWN= " & fg_hwnd & " " & "PID= " & pid)
End Sub
Thank you in advance
-- modified at 15:44 Thursday 26th July, 2007
|
|
|
|
|
I'm populating the 2 combobox columns with data. The first selection on the first column will affect the 2nd column on the same row, only on the same row. I mean that the combobox collection on the 2nd column is populated with data based on the selection on the combobox of the 1st column. Each row is independent with each other.
Can anyone tell me how to code this all, please? Thank You Very Much.
Ryan
|
|
|
|
|
|
What I want to do is, i have datatable that is populated by MySQL Table. I want to be able to bind the col to specifice text boxes. There is only going to be one row that is going to be use.
Idea i would like to do it that way. if not i can make datagrid and bind that way, i dont know the correct systex to make it work. i was looking on this website and i found an example but i does not work..Im using VB.net 2005 Express or i can do it in VB.net 2003..
I need to know to do this in code.. please
Thank you
Shane
|
|
|
|
|
The only way to do this, is to get your row, and set each textboxes text to be the contents of the columns you want them to be.
What do you mean you found an example, but it doesn't work ? If you posted the code, and what goes wrong, we'd probably be able to help a little more.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I got it to work. I used a datagrid and hide it and use this code to put into the text put into the text boxes.. this data is only for read only does not need to be use again after the program opens. its only query on speficet piece of data for that day they open the program.
dgview.rows(0).colums(0).value.tostring or something like that..
Thanks for u try to help me..
sorry, i should have post the code that i was talking about...
im very new to ask for help like this on message bords...
Thank you
Shane
|
|
|
|
|
I have two questions regarding updating an Access Database using the Update command for an OleDbDataAdapter.
1. A DataTable that has been filled using the DataAdapter Fill() command is bound to a DataGridView through the DataSource and DataMember commands of the DataGridView. After changing some values in the DataGridView, I use the DataAdapter.Update() command to record the changes in the grid in the Access Database. If I make a change to a cell and then move the cursor to another row, the change is recorded; however, if the cursor is not moved to another row, then changes made to the row in which is selection remains are not reflected in the Access Database after the Update() command. I have tried using the DataGridView commands EndEdit(), RefreshEdit(), and Refresh() and none of those commands cause changes in the most recently selected row to be reflected in the updated Access Database. Any suggestions?
2. A DataTable is filled using the DataAdapter Fill() command. Rows containing data are then added to the DataTable. After adding the rows, the DataTable is bound to a DataGridView through the DataSource and DataMember commands and then the DataAdapter.Update() is used to update the Access Database. This generates an error "Update requires a valid InsertCommand when passed DataRow collection with new rows." I cannot figure out how to use the InsertCommand(). The difficulty is likely because I don't understand how to use the CommandBuilder. Any suggestions?
Rich Feldman
|
|
|
|