I am having a bit of problem with this code:
Dim cmd As New OleDb.OleDbCommand("INSERT INTO help (Name, Email,
telephone, description)VALUES('" & txtName.Text & "','" &
txtEmail.Text & "','" & txtTelephone.Text & "','" &
txtDescription.Text & "')", New OleDb.OleDbConnection(strconn))
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Form2.Show()
Me.Hide()
it does nothing, the new form does not show and me does not hide.
thanks for any help. 4 1467
On May 8, 12:47 pm, Ron <pts4...@yahoo.comwrote:
I am having a bit of problem with this code:
Dim cmd As New OleDb.OleDbCommand("INSERT INTO help (Name, Email,
telephone, description)VALUES('" & txtName.Text & "','" &
txtEmail.Text & "','" & txtTelephone.Text & "','" &
txtDescription.Text & "')", New OleDb.OleDbConnection(strconn))
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Form2.Show()
Me.Hide()
it does nothing, the new form does not show and me does not hide.
thanks for any help.
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
I guessing that strconn is supposed to be a string that equals your
OleDb connection string to your database. To get the appropriate
format see www.connectionstrings.com
Here's is how I would write your code:
Dim conn As New OleDbConnection("enter your connection string here")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into help(Name, Email,
telephone, description) Values ('{0}', '{1}', '{2}', '{3}')",
txtName.Text, txtEmail.Text, txtTelephone.Text, txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Try this:
Dim f As New Form2()
f.Show()
Me.Hide()
That should create a new instance (instantiate) of Form2 and show it.
Immediately afterwards it will hide the calling form. Is that what you
were looking for?
Thanks,
Seth Rowe
On May 8, 1:22 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 8, 12:47 pm, Ron <pts4...@yahoo.comwrote:
I am having a bit of problem with this code:
Dim cmd As New OleDb.OleDbCommand("INSERT INTO help (Name, Email,
telephone, description)VALUES('" & txtName.Text & "','" &
txtEmail.Text & "','" & txtTelephone.Text & "','" &
txtDescription.Text & "')", New OleDb.OleDbConnection(strconn))
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Form2.Show()
Me.Hide()
it does nothing, the new form does not show and me does not hide.
thanks for any help.
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
I guessing that strconn is supposed to be a string that equals your
OleDb connection string to your database. To get the appropriate
format seewww.connectionstrings.com
Here's is how I would write your code:
Dim conn As New OleDbConnection("enter your connection string here")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into help(Name, Email,
telephone, description) Values ('{0}', '{1}', '{2}', '{3}')",
txtName.Text, txtEmail.Text, txtTelephone.Text, txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Try this:
Dim f As New Form2()
f.Show()
Me.Hide()
That should create a new instance (instantiate) of Form2 and show it.
Immediately afterwards it will hide the calling form. Is that what you
were looking for?
Thanks,
Seth Rowe
thanks, I tried, ther strconn went away but now when I open form2,
or go to it by pressing the button and go into a textbox by clicking
in a textbox I get an error LoaderLock detected
On May 8, 1:31 pm, Ron <pts4...@yahoo.comwrote:
On May 8, 1:22 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 8, 12:47 pm, Ron <pts4...@yahoo.comwrote:
I am having a bit of problem with this code:
Dim cmd As New OleDb.OleDbCommand("INSERT INTO help (Name, Email,
telephone, description)VALUES('" & txtName.Text & "','" &
txtEmail.Text & "','" & txtTelephone.Text & "','" &
txtDescription.Text & "')", New OleDb.OleDbConnection(strconn))
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Form2.Show()
Me.Hide()
it does nothing, the new form does not show and me does not hide.
thanks for any help.
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
I guessing that strconn is supposed to be a string that equals your
OleDb connection string to your database. To get the appropriate
format seewww.connectionstrings.com
Here's is how I would write your code:
Dim conn As New OleDbConnection("enter your connection string here")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into help(Name, Email,
telephone, description) Values ('{0}', '{1}', '{2}', '{3}')",
txtName.Text, txtEmail.Text, txtTelephone.Text, txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Try this:
Dim f As New Form2()
f.Show()
Me.Hide()
That should create a new instance (instantiate) of Form2 and show it.
Immediately afterwards it will hide the calling form. Is that what you
were looking for?
Thanks,
Seth Rowe
thanks, I tried, ther strconn went away but now when I open form2,
or go to it by pressing the button and go into a textbox by clicking
in a textbox I get an error LoaderLock detected
Wow - that was a scrambled sentence. First things first - the database
interaction is working and form2 is showing right?
Thanks,
Seth Rowe
On May 8, 1:38 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 8, 1:31 pm, Ron <pts4...@yahoo.comwrote:
On May 8, 1:22 pm, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 8, 12:47 pm, Ron <pts4...@yahoo.comwrote:
I am having a bit of problem with this code:
Dim cmd As New OleDb.OleDbCommand("INSERT INTO help (Name, Email,
telephone, description)VALUES('" & txtName.Text & "','" &
txtEmail.Text & "','" & txtTelephone.Text & "','" &
txtDescription.Text & "')", New OleDb.OleDbConnection(strconn))
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Form2.Show()
Me.Hide()
it does nothing, the new form does not show and me does not hide.
thanks for any help.
at the end, strconn is underlined in blue and says not defined, I
dont know what to do with this, how do I define it?
I guessing that strconn is supposed to be a string that equals your
OleDb connection string to your database. To get the appropriate
format seewww.connectionstrings.com
Here's is how I would write your code:
Dim conn As New OleDbConnection("enter your connection string here")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into help(Name, Email,
telephone, description) Values ('{0}', '{1}', '{2}', '{3}')",
txtName.Text, txtEmail.Text, txtTelephone.Text, txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
Also I have 2 forms...one button shold hide the one form and show
another, here is the code I have and it is not working:
Try this:
Dim f As New Form2()
f.Show()
Me.Hide()
That should create a new instance (instantiate) of Form2 and show it.
Immediately afterwards it will hide the calling form. Is that what you
were looking for?
Thanks,
Seth Rowe
thanks, I tried, ther strconn went away but now when I open form2,
or go to it by pressing the button and go into a textbox by clicking
in a textbox I get an error LoaderLock detected
Wow - that was a scrambled sentence. First things first - the database
interaction is working and form2 is showing right?
Thanks,
Seth Rowe
Wow yes I don't know what happened with that sentence. Anyway, yes
the database is read into a datagrid and displayed on form1 at
startup, on load.
here is my code for both forms.
this is for form1.vb, frmmain
Imports System.Data.OleDb
Public Class frmMain
Dim olecn As New _
OleDb.OleDbConnection("Provider=Microsoft.jet.oled b.4.0;" & _
"Data Source=helpdesk.mdb")
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim olecmd As New OleDbCommand _
("Select * from help", olecn)
Dim oleda As New OleDbDataAdapter(olecmd)
Dim oleds As New DataSet
oleda.Fill(oleds)
dgvHelp.DataSource = oleds.Tables(0)
End Sub
Private Sub dgvHelp_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
dgvHelp.CellContentClick
End Sub
Private Sub btnNewCall_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnNewCall.Click
Dim f As New Form2()
f.Show()
Me.Hide()
End Sub
End Class
this is for form2, form2
Imports System.Data.OleDb
Public Class Form2
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim conn As New OleDbConnection("enter your connection string
here")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into
help(Name, Email, telephone, description) Values ('{0}', '{1}', '{2}',
'{3}')", txtName.Text, txtEmail.Text, txtTelephone.Text,
txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
End sub
End Class This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Arturo DiDonna |
last post by:
Hello everyone. I am trying to compile someone else code and I am
stuck with compilation problems using
the g++ 3.3 compiler. Basically, when compiling the following code, I
get this error...
|
by: Jim |
last post by:
I have spent the past few weeks designing a database for my company.
The problem is I have started running into what I believe are stack
overflow problems. There are two tab controls on the form...
|
by: Andi Twine |
last post by:
Hi all,
I really hope someone here can help !
I have designed and built an ASP.NET web service with Visual Studio .NET.
The web service outputs some dummy XML data when its called with some...
|
by: ZMan |
last post by:
Scenario:
This is about debugging server side scripts that make calls to
middle-tier business DLLs. The server side scripts are legacy ASP 3.0
pages, and the DLLs are managed DLLs...
|
by: Brian |
last post by:
NOTE ALSO POSTED IN
microsoft.public.dotnet.framework.aspnet.buildingcontrols
I have solved most of my Server Control Collection property issues.
I wrote an HTML page that describes all of the...
|
by: matvdl |
last post by:
I have a system that was originally developed in asp - the pages are saved in
SQL (there are over 10,000 pages) and saved to a temp directory in the server
when requested by a client.
I have...
|
by: Oliver |
last post by:
I have a very wired problem requesting one specific url from within my
application.
I have struggeled with this for 5 hours now, and searched google withour any
luck, so i hope that someone are...
|
by: TORQUE |
last post by:
Hi,
Im wondering if anyone can help me with a problem.
I have a form with more than 50 unbound fields.
Some of the fields will be blank from time to time.
This seems to be where im having...
|
by: David |
last post by:
Hello all. I am trying to implement my first server control and have
run into two problems that I cannot solve. I need the assistance of
someone with more experience.
My goal was to create an...
|
by: truthlover |
last post by:
I have a problem that's difficult to explain, so please be patient.
The database is in 2000 format, though I'm doing most of the designing in 2007 (saved as 2000 format, of course)
I have a...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |