|
Pete Belcher wrote:
Visual Basic 6.0 that use ADO to talk to both a SQL Server database and also an MS Access 2000 database
Please post the connection string between VB -> SQL and VB -> Ms access.
Pete Belcher wrote:
when trying to do the same on the MS Access database only SELECT and DELETE works? INSERT and UPDATE cause the program to freeze. No errors are thrown up, the program just locks up
Please post the code that have a problem in your application. One morething, do you use VB6 or VB.Net?
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Found out it was the actual PC that was failing!!
Install MS Access to see if a driver etc was missing but MS Access was unable to open any tables within ANY database. You could open an Access database and see the tables but whenever you tried to open the table an error box appeared with just "Unknown" written in it!!
Guessing whatever it was that caused Access to fail also caused my application to fail!! Tried to reinstall Windows but the Keyboard no longer works etc... Something very odd is happening!!
Setting up another new machine from scratch to see if it will work!
Thanks for your suggestions though!
- Pete -
|
|
|
|
|
Hi
i use this code to retrieve my image field from sql server
(my file isn't picture !!!)
***********
Dim MyData() As Byte
MyData = Ds.Tables(mytable).Rows(0).Item(myfield) 'For Example
Dim K As Long
K = UBound(MyData)
Dim fs As New FileStream("c:\mkh.xml", FileMode.OpenOrCreate, FileAccess.Write) 'in this line get error
fs.Write(MyData, 0, K)
fs.Close()
fs = Nothing
Ds = Nothing
************
but it doesn't work and give me this error in ASP.Net(With Vb)
<<access to="" the="" path="" "c:\mkh.xml"="" is="" denied.="">>
i get this code from microsoft msdn and alot of furoms !!!!
then why doesn't work??
MkhProgrammer
|
|
|
|
|
In my opinion, this my be came from the security setting of your folder. Try to go to windows explorer and right click on the folder that contain file that you want to access the information (in this case your file in the root drive C:\ ) then click on the Properties of the context menu. Then click on the Security tab then click Add group. In the Select computer, user, or group dialog box click Advance button and click Find now button. Then select ASPNET from the list then click OK button. Then give the ASPNET group with Read and Write permission.
Note: If the SECURITY tab did not display in the the properties dialog box, go to Start menu -> Control panel -> Tools -> Folder Option -> View tab , in the Advance setting list make sure that option Use simeple file sharing (Recommend) is cleared.
Try to do it and let me know if it woork or not... Good luck
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Thanks The man from SCN-CO
I do that and it work !!!!
but i can't do this in any computer that has this acount ?!!!
always we should do this ??
thanks again
best regards
MkhProgrammer
|
|
|
|
|
Does the other computer has the .Net framework install on it? Or did you create the setup project for your application? I got this idea from this book[^] while I read the chapter of working with ASP.NET.
MKhayatan wrote:
but i can't do this in any computer that has this acount ?!!!
always we should do this ??
I'm not sure too with this area, I have only one machine that have the problem and I write an application for testing purpose only. I did not deploy it to any other machine.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
hi,i have to develop a Speech Recognition system with VB.Net.
I would like to know is there any free software download available for speech recognition?
Beside that, may i know what the difference between Micosoft Speech SDK and Microsoft Agent?
|
|
|
|
|
I am trying to make one cell in a DataGrid bold based on it's value (i.e. If a customer's number of orders is greater than ten, bold the orders field for that customer). I read somewhere that the key to doing this is through the DataGridColumnStyles but I can't seem to find anything there for this. Does anybody know how this gets done?
You think you know everything
I'll show you what everyone else can see
It's too late to change anything
What's here is all that we need to be!
|
|
|
|
|
Private Sub myDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles myDataGrid.ItemDataBound
If CType(e.Item.Cells(2).Text, Integer) > 10 Then
e.Item.Cells(2).ForeColor = Color.Red
End If
End Sub
You can put in something like this.
A datagrid is zero-based, so this(cells(2)) would be the third column from the left.
Have Fun!
|
|
|
|
|
Hye..how to write the code to check hardware status whether is function properly or not?
|
|
|
|
|
Well, this question is for both VB and C# programers
This is a chapter from C# help that best explains my problem:
Invoking an event: Once a class has declared an event, it can treat that event just like a field of the indicated delegate type. The field will either be null, if no client has hooked up a delegate to the event, or else it refers to a delegate that should be called when the event is invoked. Thus, invoking an event is generally done by first checking for null and then calling the event.
if (Changed != null)
Changed(this, e);
The question is how to make a runtime check in VB (just like in this C# example) to see if any event handler is hooked on that event.
|
|
|
|
|
Actually, it's not a problem at all. VB handles event a little differnetly than C# does. You COULD do the equivilent of C#'s code by doing something like this:
If Not Changed Is Nothing Then
RaiseEvent Changed(Me, e)
End If
But, you don't have to do this at all. When the RaiseEvent statement is executed, it automatically checks to see if there are any subscribers. If there are, then the event is raised with each subscriber, if not, nothing happens.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks David for your reply
If Not Changed Is Nothing Then
RaiseEvent Changed(Me, e)
End If
First line doesn't work cos you can't call 'Changed' directly (in if...then).
You can only write: RaiseEvent Changed (Me,e)
But as You explained to me, I don't need if...then, and that is enough for me .
Thanks Davor
|
|
|
|
|
I am trying to extract word information from vb app.
when I select a particular file like ms word document
I want to get all or a part of text and put it in DB or
another text to display. The thing is in order to load
word document in object I need to open MS word.
If only one file is selected, no problem. However,
I want to manage multiple files( say 100 ) to do the
same thing. In this case I have to open/close word 100 times,
right? I am afraid it will slow the process and I don't
want to see ms word open/close a hundred of times.
I know if I pay the money, there is a couple of solution.
I am not ready to spend my money unless there is nothing
I can do about.
anyone has a solution to this?
|
|
|
|
|
You don't need to SHOW any of those Word documents. Additionally you should do something like this: open word, open doc, get data, close doc, open next, etc.
|
|
|
|
|
Are there any default thread protection objects in VB6? I want to make sure that only 1 function can run on a given block of code at any given time. VB6 is worrying me because everything is event driven and I do not control the threads in the same manner that I would in C++. Can someone point me to some API's or classes already included with VB6 that are similar to a mutex or semaphore?
|
|
|
|
|
Pualee wrote:
Are there any default thread protection objects in VB6?
No, there isn't. There is no multithreading support in VB6 at all. All code and UI updates run on a single thread.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it possible to format a column in a datagrid using VB.Net to replicate a phone number? I am getting either a 0 or a ten digit number. I would like to display the ten digit number as a phone number in the datagrid (ex:123-456-7899). Is this possible?
Thanks in advance,
Beginner in VB.Net
|
|
|
|
|
Whats with this? Is it possible for code to be removed from a file?
My OS is Windows XP SP-2.
When I click Start and Search the search window opens with the search companion (dog) but there are no input boxes, text boxes, search button or any dialog boxes what so ever on the page. The left and right pains are empty. The window shows the menu bar (File-Edit-View etc) and the button bar along with a search bar and thats it. I can't do a search. Something has stripped the components from the window.
Maybe just a coincidence, but I noticed the problem started after installing SP-2.
Everything else seems to run fine. jscript.dll is present and registered and I have checked the registry for possible errors.
For those interested, more info on this topic visit:
http://www.lavasoftsupport.com/index.php?showtopic=47763&hl=
|
|
|
|
|
And this has what to do with Visual Basic .NET?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a windows application that implements a treeview control of vb.net.This tree has various nodes and subnodes, upon the click of the node, a web page should be displayed in IE...really stuck with this since many days.Please provide help.Thnak you
|
|
|
|
|
I am having a problem in re-ordering the data I am returning to a data set. Briefly, I want the user to be able to re-order the elements of my datagrid using up and down buttons, ie select a row, click up or down to move it!!
Any suggestions
|
|
|
|
|
Ignore me if i got the wrong idea but.
When you click on a row , you could get the index for that row, you could then get the previous or next row index's based on what 'arrow' is clicked and then set the index's to each other.
For eg. If you clicked on row 8, and then click on the up arrow, the code gets index 7, sets row 8 to index 7, and row 7 to index 8, updates the dataset and then calls DataBind refresh the Grid, as to give the illusion of the row moving up or down.
Hope this helps
Chris
|
|
|
|
|
Thanks for that...I had the same idea yest after the post..this is the code I came up with..
Dim cm As CurrencyManager = CType(Me.BindingContext(DataGrid1.DataSource, DataGrid1.DataMember), CurrencyManager)
Dim dv As DataView = CType(cm.List, DataView) ' Retrieve the default DataView of the DataGrid
Dim dr As DataRow ' Use Currency Manager and DataView to retrieve the Current Row
Dim dr2 As DataRow ' setup another datarow variable to store the "move to" line
Dim newOrderNo As Integer ' the temp variable to store the integer for the new row location
Dim currentOrderNo As Integer ' the temp variable to store the integer for the selected row location
'set bounds for the top element on the datagrid
If cm.Position = 0 Then
Me.DataGrid1.Select(0)
Me.DataGrid1.CurrentRowIndex = 0
Exit Sub
End If
dr = dv.Item(cm.Position).Row ' get the details of the row selected
dr2 = dv.Item(cm.Position - 1).Row ' get the details of the row above in the dataset
currentOrderNo = dr.ItemArray(2) ' assign the integer value to a temp variable
newOrderNo = (currentOrderNo - 1) ' decrement the selected row integer value
''''swap the integer values, re-order and move "selected row" up ie work with the same row
dr.Item(2) = newOrderNo
dr2.Item(2) = currentOrderNo
dsDelivery.Tables(0).DefaultView.Sort = "DelOrder"
DataGrid1.Select(newOrderNo - 1)
DataGrid1.CurrentRowIndex = newOrderNo - 1
DataGrid1.Refresh()
|
|
|
|
|
Hi, I want to find any resource on the web on how to use chart control in vb.net step by step. Can anyone provide me some information(URL)?
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|