|
An integer in .NET is 32 bits
If you want to get a 16 bit number use Int16...
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I have tryed to change all of the integers to int16 but it didn't help!
i have one solution that i have been using and that is to create a dll using vb 6.0 and referance it in vb.net
that solution works great but only om my computer. on other computers i get a error, something about dll is now registered
i have tried using "c:\WINDOWS\system32\regsvr32.exe" but that dosen't work either??
help please?
|
|
|
|
|
Hi, I have som dynamic data that I want to send via Email with CDO.Message but I dont know
how I get the Loop inside the msg.HTMLBody.
This is the code I need to run to create the dynamic part, how to I get it inside the msg,HTMLBody?
sTotal = 0
For Each Key in dictCart
aParameters = GetItemParameters(Key)
%>
<%= aParameters(1) %><%= dictCart(Key) %><%= strCurrency%> <%= aParameters(2) %><%= strCurrency%> <%= FormatNumber(dictCart(Key) * CSng(aParameters(2)),2) %>
<%
sTotal = sTotal + (dictCart(Key) * CSng(aParameters(2)))
Next
'Calculate shipping - you might want to pull this out into a function if your shipping
' calculations are more complicated then ours.
If sTotal <> 0 Then
If strCurrency = "SEK" Then
sShipping = (rsShipping.Fields.Item("FieldShippingSEK").Value)
Else IF strCurrency = "USD" Then
sShipping = (rsShipping.Fields.Item("FieldShippingUSD").Value)
Else
sShipping = (rsShipping.Fields.Item("FieldShippingEUR").Value)
End IF
End IF
Else
sShipping = 0
End If
sTotal = sTotal + sShipping
%>
Shipping (<%=strCountry%>):<%= strCurrency%> <%= FormatNumber(sShipping,2) %>TOTAL:<%= strCurrency%> <%= FormatNumber(sTotal,2) %>
Best Regards
Martin
|
|
|
|
|
Hello All
how can i connect to remote sql server FROM VB6
This is my sample connections strings
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim str As String
On Error GoTo HAND
cn.ConnectionTimeout = 30
Dim ConnString As String
Method 1
--------
cn.Open "Trusted_Connection=yes;driver=SQL Server;server=20.19.69.13;database=XXXX;User Id=YYYYY;Password=ZZZZ"
str = "Provider=SQLOLEDB.1;Server=23.19.69.13;Database=xxxx;Uid=yyyy;Pwd=zzzz"
cn.Open str
Method 2
--------
cn.Open "Provider=MS Remote;Data Source=XXXX;Remote Server=http://www.mysite.com;USER ID=XXX;PASSWORD=YYYY"
|
|
|
|
|
Try to check the connection from here[^] and let me know whether it is working not.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I have recently written a program in Visual Basic 6.0 that use ADO to talk to both a SQL Server database and also an MS Access 2000 database. They both use the same code to talk to the database.
When run on the development machine (XP Pro) the program can talk to the SQL Server database and MS Access database with ease.
When run on a virginal XP Pro machine the program can talk to the SQL Server database - SELECT, UPDATE, INSERT and DELETE all work fine. However, 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!
I have checked the folder / file permissions of the MS Access database to ensure I have the correct priviledges (I do) but cannot resolve the problem?!
I am a bit desperate here as the program needs to be delivered in the next week and this was the final stage of packaging!
Many thanks in advance!
- Pete -
|
|
|
|
|
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=
|
|
|
|