|
First, DAO was deprecated a long time ago. In VB.NET, you should be using the System.Data.OleDb namespace to use an Access database. The equivelent code to what you posted would be something like this:
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _
"C:\[PathToMDBFile]\dbFile.mdb"
Dim myConnection As New OleDbConnection(connString)
myConnection.Open()
myConnection.Close()
BTW: DBEngine was never declared anywhere in your code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
True, in VB6 DBEngine was never used. But i read the clause DBEngine.OpenDatabase somewhere in the help of Studio .NET
It's also a part of the DAO library. DAO.DBEngine.... Still in that case it didn't let me use it, saying its not a shared member.
Anyways, OLE DB works fine, so i'll get on with it
|
|
|
|
|
I have been searching for simple examples of how to do remoting with VB.NET. What I desire is a remoting object that exposes some shared functions to return other objects. I am currently using console applications as my test environment. Here is my object that should be created by the shared function and returned to the client.
<Serializable()> _
Public Class SampleObject
Private mName
Private mData
Public Sub New()
Console.WriteLine("Object Created")
End Sub
Public Property Name() As String
Get
Return mName
End Get
Set(ByVal Value As String)
mName = Value
End Set
End Property
Public Property Data() As String
Get
Return mData
End Get
Set(ByVal Value As String)
mData = Value
End Set
End Property
Public Overrides Function ToString() As String
Return mName & " " & mData
End Function
End Class
Now, my server has a class that will populate the object:
Public Class Creator
Inherits MarshalByRefObject
Public Shared Function CreateSampleObject() As RemotingObject.SampleObject
Dim NewObj As New RemotingObject.SampleObject
NewObj.Name = "Hello"
NewObj.Data = "World"
Return NewObj
End Function
End Class
The problem is that I do not understand where the Creator needs to be. Does a reference need to exist in both the client and server? If not, how do I activate a class of the object.
Here is my server console application:
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp
Module Server
Sub Main()
RemotingConfiguration.ApplicationName = "Server"
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(Creator), "object.rem", _
WellKnownObjectMode.SingleCall)
Dim mChannel As New TcpChannel(1441)
ChannelServices.RegisterChannel(mChannel)
mChannel.StartListening(Nothing)
Console.WriteLine("Listening on port: 1441")
Console.ReadLine()
mChannel.StopListening(Nothing)
End Sub
End Module
Finally, the client (as it stands right now -- and it doesn't work)
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp
Module Client
Sub Main()
Dim TCP As New TcpChannel(1441)
ChannelServices.RegisterChannel(TCP)
RemotingConfiguration.RegisterWellKnownClientType( _
Type.GetType("RemotingServer.Creator"), _
"tcp://localhost:1441/Server/object.rem")
Dim NewCreator As Object = Activator.GetObject( _
Type.GetType("RemotingServer.Creator"), _
"tcp://localhost:1441/Server/object.rem")
Dim NewObj As RemotingObject.SampleObject = _
NewCreator.CreateSampleObject
Console.WriteLine(NewObject.ToString)
Console.ReadLine()
End Sub
End Module
Thanks for any input or articles/sample code that I can get my hands on!
|
|
|
|
|
Hello,
I attach a "Rich Text Box" on a form in Vb.net. Then i add a "Button" control from toolbar to a form.
I want that when i click on "Print" button, then the text displayed in "Rich Text Box", will be printed.
How can i do this????
Kindly help me in this regard urgently.
Regards,
Eshban
EsHbAn BaHaDuR
|
|
|
|
|
|
Ok, here's the situation. I have a form named "Form1" and a DataGrid named "DataGrid1". What I want to do is make the Column 1 of the Datagrid, a listbox with for exemple "Yes" and "No" for the choice of values.
Can someone help me out?
Thanks
|
|
|
|
|
you may be better off placing these options in a combobox control rather than a listbox. just my opinion. but either way the implmentation should be similar. have a look at this syncfusion windows forms faq topic.
-jim
|
|
|
|
|
heloo
any body can help me to lower me immages which are in jpeg format
thank yous
Dr yousef
|
|
|
|
|
The only way to do that with a JPEG is to either decrease the dimensions of the image or lower the image quality. JPEG images are already in just about the smallext size you can get them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am looking for the following images to add to my buttons on my toolbar:
Add, Delete, Find, Edit, Save, Undo, Memo, Report, and Exit
Does anyone have these or know where I can find them? If so could you email them to me ASAP to (tim@atsbilling.com)?
Thanks in advance
Beginner in VB.Net
|
|
|
|
|
check out the vb.net icon extractor. just point it to any compiled .dll file and it will pull any embedded icons out for you. i think the icons you are looking for reside in mscor.dll. just point the application to your system32 directory and you should get everything you need.
icon extractor
-jim
|
|
|
|
|
Thanks again Jim;)
Beginner in VB.Net
|
|
|
|
|
Still looking for a few. I don't have a mscor.dll file on my computer. Can you send it too me? Thanks.
Beginner in VB.Net
|
|
|
|
|
when we enter the username and password,then how can i check this user exist in network server(localserver) using VB.net windows applicatios .in this i used net.networkaccess.connect.but i did not get correct answer.
greetings
|
|
|
|
|
You might want to tell us what kind of server your checking this username and password against. We'll need alot more information than this to tell you what you need to do.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
anybody plzzzz help
when i enter a name and password in my text box then, how can i identify is it exist in our server
(intranet) using Vb.net windows application,if it not exist then "invalid user message" display on the label error.if it exist then go to product page
greetings
|
|
|
|
|
Server Error in '/Log_In' Application.
--------------------------------------------------------------------------------
The name 'adamtel' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: The name 'adamtel' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
Source Error:
Line 158: .Connection.Open()
Line 159: .CommandText = stSQL
Line 160: milestone_Rows = .ExecuteNonQuery()
Line 161: If milestone_Rows <> 1 Then
Line 162: MsgBox("Did not insert row")
Source File: C:\Inetpub\wwwroot\Log_In\milestone.aspx.vb Line: 160
Stack Trace:
[OleDbException (0x80040e14): The name 'adamtel' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.]
System.Data.OleDb.OleDbDataReader.NextResults(IMultipleResults imultipleResults, OleDbConnection connection, OleDbCommand command)
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
Log_In.milestone.milestoneAdd() in C:\Inetpub\wwwroot\Log_In\milestone.aspx.vb:160
Log_In.milestone.btnadd_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Log_In\milestone.aspx.vb:125
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
|
|
|
|
|
To me this sounds like you have a problem with your sql query syntax
|
|
|
|
|
yeah, that's rite, i have sql queries problems
thanks Gavin
|
|
|
|
|
Hi all,
Hope this is an easy one...
Here is the problem:
In the code-behind, I have dynamically built a series of tablecells each with a Literal control containing an image.
----------------------------------------------------------------------------
dim litCont as New System.Web.UI.WebControls.Literal()
dim strValue as string = "testString"
dim contStr as string = "<img name='pix1' onMouseDown='doMouseDown("& strValue &")' src='images/pix1.jpg' />"
litCont.text = contStr
objCell.Controls.Add(litCont)
----------------------------------------------------------------------------
When the user clicks on any of the images it fires the JavaScript function doMouseDown() which receives a string parameter.
QUESTION: How could I then pass the value of the str parameter to the Label Control ("legend") in "Form1" so that the label may be updated?
I have simplified the structure of the form
----------------------------------------------------------------------------
<html>
<head>
<script language="javaScript">
<!--
function doMouseDown(str){
// code stuff here
}
-->
</script>
</head>
<body >
<form id="form1" runat="server">
<asp:table id="mainTable" runat="server" >
<asp:tableRow runat="server">
<asp:tableCell runat="server">
<asp:label id="legend" runat="server" />
</asp:tableCell>
</asp:tableRow>
</asp:table>
</form>
</body>
</html>
------------------------------------------------------------------------
Thank you
|
|
|
|
|
Your question would be better handled in the ASP.NET Forum[^]. Your question has nothing to do with VB.NET. The solution would be based entirely in JavaScript and the HTML that's generated by the asp tagged controls (Hint, Hint!)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok, I'll seek enlightment in other spheres.
pyb
A true guru not only knows, he can teach too.
|
|
|
|
|
document.GetElementByID("yourlabelname").value = str
hope this helps.
DADA
|
|
|
|
|
Hello Dada,
Thanks for your help.
<i>document.getElementById('legend').innerHTML = str;</i>
The line above is actually what works for me in this particular situation.
Anyway, thanks a lot for taking the time to help.
Cheers,
Pyb
|
|
|
|
|
I implemented a keyboard based tab system in my program. When you are in a control if you press "Enter" then the next control is focused as if you have pressed tab key. What the problem is that when you are in a DateTimePicker or TextControl and press "Enter" a "Dong" sound is heard which is like an error indicatior. How can I get rid of this sound?
|
|
|
|