|
That's insane! Oh well, it's their money...
The way I've done it in the past is to put a PlaceHolder control on the page where you want the new controls to show up. This make it much easier to control the placement of generated controls. Next, when you put the new control in the PlaceHolder's Controls collection, you'll have to wire up the event handlers yourself. The basic code is something like this:
Dim myCalendar As New Calendar
myCalendar.ID = "myCalendar"
AddHandler [add any event handlers and function delegates here]
RageInTheMachine9532
|
|
|
|
|
Hi, I'm creating a COM Dll using VB6, I created simple functions to make an update on a database, but it doesn't work, I'm using an ASP Page that succesfully create the object but gives me errors when I try to insert or update data (Also I tried creating the object from other VB Application but didn't work either, 'weird' but when I use this code on a EXE it works, but I need this in a COM Dll).
VB Dll Code
Public Function Save()<br />
Dim Cn As New ADODB.Connection<br />
<br />
Cn.ConnectionTimeout = 100<br />
Cn.ConnectionString = "DBQ=test.mdb;" & _<br />
"DRIVER={Microsoft Access Driver (*.mdb)};" & _<br />
"DefaultDir=C:\My Docs\My Source Code\VB\ASP-COM Test;" & _<br />
"UID=admin; PWD=;"<br />
Cn.Mode = adModeReadWrite<br />
Cn.Open<br />
<br />
Cn.Execute "INSERT INTO tests (test_value) VALUES ('test3')"<br />
<br />
Cn.Close<br />
<br />
Save = True<br />
End Function
ASP page code
<%<br />
Dim iTest<br />
Set iTest = Server.CreateObject("TestProject.Test")<br />
<br />
Response.Write iTest.Save<br />
%>
Like this it returns this error
Error Type:<br />
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<br />
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.<br />
/xue2/index.asp, line 6
I also tried using a RecordSet Object but gives this error:
Error Type:<br />
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<br />
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.<br />
/xue2/index.asp, line 6
Thanks if anyone can help!
Vertigo
|
|
|
|
|
Hi
I faced similar problems with {Microsoft Access Driver (*.mdb)}; provider
try : OLEDB jet provider :
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=admin; Password=;"
and check http://www.connectionstrings.com [^]for more
|
|
|
|
|
Oh!, thank you for your answer, I tried before the same connection string with no positive results , but I found the solution , it was not big deal, it was nothing in the code, it was a problem with permissions in the IIS Configuration (Not using Anonymous Access [chosen by default when you create a virtual directory], the correct one was using the Integrated Windows Authentication.). I lost a complete day in a such thing but it happens .
Anyway, Thx for your help,
Vertigo
|
|
|
|
|
i have a string and i was wondering how i could grab each character of that string for example in c++ if
string="Hello World"
then
string[3]
would return a "l"
thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
mid("Hello World",4,1)
returns "l"
note that in VB6 the first character index is 1 not 0 like C.
|
|
|
|
|
awsoem thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
You can also get them easily using the Chars property:
<br />
Dim s As String<br />
Dim i As Integer<br />
<br />
s = "one for the toad"<br />
For i = 0 To (s.Length - 1)<br />
Console.WriteLine(s.Chars(i))<br />
Next<br />
Note that most of the properties, etc. dealing with arrays in the BCL use zero-based indexing. It can be confusing switching back and forth between zero- and one-based indexing.
[EDIT] I misunderstood, and assumed the question was for VB .NET . I apologize. Back to the C# forums for this geek. [/EDIT]
Regards,
Jeff Varszegi
EEEP! An Extensible Expression Evaluation Package
|
|
|
|
|
could someone show me all the commands used for drawing in a picture box? (an example each would be helpful)?
is it possible to draw text in a picture box? preferabley without having to draw each pixel of each letter, u know like is there a command i could use? and could i make it centered?
thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
You didn't mention which version of VB, so I'll assume VB.NET. First, you create a Graphics object from the PictureBox's CreateGreaphics method. Then you can use the Graphics object to draw on the PictureBox. The PictureBox itself doesn't have any drawing methods. See the documentation on the Graphics class for explanations and examples. There is just way too much information to post here.
System.Drawing.Graphics class docs[^]
RageInTheMachine9532
|
|
|
|
|
actually i need it for vb 6
thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
OK. The VB6 PictureBox docs start here[^]. You can use the Print method to display text in the picturebox anywhere you want. Just remember to set the PictureBox AutoRedraw property to True first.
RageInTheMachine9532
|
|
|
|
|
how do i print a form (with all its color and everything)?
how can i pring a picture box (with all its color and everything)?
thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
in c++ dmensional arrays were defined like:
int array[][];
are dimensional arrays possible in vb and if so how do i define/use them?
thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
Dim myVar(10, 10, 10) As Long
Dim myVar(10) As Long
Dim myVar2() As Long
VB.NET only:
Dim myVar As Array = Array.CreateInstance(GetType(Integer), 10)
Dim myVar As Array = Array.CreateInstance(GetType(Integer), 10, 10)
RageInTheMachine9532
|
|
|
|
|
thank you
---------------------
And Like The Wind Our Hero Vanishes Off Into The Distance...
|
|
|
|
|
I am developing an asp.net application using vb. I have a hyperlink control in my repeater template and I am not able to dynamically create parameters for its querystring. The parameter is the same value as the text. The reason I am using a hyperlink against a linkbutton is that I want the target window to be a popup.
<asp:HyperLink NavigateUrl="javascript:var w =window.open('Details.aspx?Name=<b>(what do I do here)</b>',null,'width=400,height=400,location=no')"
Text = <%# DataBinder.Eval(CType(Container, RepeaterItem).DataItem, "Name") %> Runat="server" ID="Hyperlink1"></asp:HyperLink>
|
|
|
|
|
hello all,
how shall i make my application, memory residant. I mean how shall i design Terminate and Stay Residant application using VisualBasic.
ComputerNewton
|
|
|
|
|
There is no such thing as a TSR in Windows. THe closet match is a Windows Service.
In VB.NET, easy, just start a Windows Service project.
RageInTheMachine9532
|
|
|
|
|
hello all,
how shall i send picture information across the network using Winsock in VisualBasic. And one more thing is that how shal i convert the BMP file to JPEG/GIF and PNG in VisualBasic.
ComputerNewton
|
|
|
|
|
hello all,
how shall i design the Remote Administration Application in VisualBasic.
ComputerNewton
|
|
|
|
|
Define "Remote Administration". What do you want this to do?
And in VB6 or VB.NET?
RageInTheMachine9532
|
|
|
|
|
i mean i would like design an application such that i can get full control of it from another system. such that i can open any file or shutdown.
just check www.radmin.com
i am planning to develope the application like this .
ComputerNewton
|
|
|
|
|
Why? It's already been done and won't take you at least 6 months to write it if you go buy PCAnywhere or something equivelent. Microsoft has their's, called RemoteDesktop...
You'll be writing 2 seperate apps to do this. The server will run on the machine you want to control, while the client will run locally. You'll be P/Invoking ALOT of Windows API functions on the server to get the screen image, follow the mouse and keyboard events, and post new keyboard and mouse events coming from the client.
This kind of project will take an average of 6 months to develop. How much do you get paid in 6 months? Compare that to the off-the-shelf cost of PCAnywhere...
RageInTheMachine9532
|
|
|
|
|
Hi,
I need help... How can I limit the rows in one field into 1 row only so that whenever I save something using VB, the content of that row would just be replaced by a new one. For example: in a textbox, if I enter a name and click save, the name that I typed would be saved on a database. If I enter a new name, the name that I entered before will just be replaced with a new one.
I used this code and I bind my richtextbox with a data control and it was running ok. But I still would like to ask for suggestions... Thanks...
Public gadocon As adodb.Connection
Public gadorset As adodb.Recordset
Private Sub cmdadd_Click()
rtbox.Locked = False
Set gadocon = New adodb.Connection
Set gadorset = New adodb.Recordset
gadocon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\gen\Desktop\TRIAL 4 THESIS\transfering form2form code\dbtext.mdb"
gadorset.Open "Table1", gadocon, adOpenKeyset, adLockOptimistic
gadorset.AddNew
gadorset.Fields(0) = Trim(rtbox.Text)
gadorset.Update
End Sub
Private Sub cmdedit_Click()
rtbox.Locked = False
End Sub
Private Sub cmdsave_Click()
Set gadocon = New adodb.Connection
Set gadorset = New adodb.Recordset
gadocon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\gen\Desktop\TRIAL 4 THESIS\transfering form2form code\dbtext.mdb"
gadorset.Open "Table1", gadocon, adOpenKeyset, adLockOptimistic
gadorset.Fields.Refresh
gadorset.Fields(0) = Trim(rtbox.Text)
gadorset.Update
frmaccept.Show
End Sub
|
|
|
|