Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Insert Into Database


Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2003, 06:00 AM
ddragas ddragas is offline
Regular
 
Join Date: Sep 2003
Location: Croatia
Posts: 83
Default Insert Into Database


Hi

I'm having problems with inserting new data into database.

Here comes code.

Please help me.

Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset

Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\vb\podaci\šifre.mdb;"
MyConn.Open
Dim sqlStr As String

sqlStr = "INSERT INTO Šifre (šifra, talijanski_opis, euro, hrvatski_opis, oznaka, dobavljač, napomena) Values (Text1.Text, text2.Text, text4, text3.Text, combo1, text6.Text, text5.Text)"

MsgBox sqlStr

Set MyRecSet = MyConn.Execute(sqlStr)
MyConn.Close



Also if somebode can help me with deleting records from database.

THNX
Reply With Quote
  #2  
Old 10-08-2003, 06:10 AM
Shurik12 Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
 
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
Default

Hi,

You seem to have forgotten to use & to append the values of the
text boxes

...Values ( '" & Text1.Text & "' ..... ( in case of text value)
...Values ( " & Text1.Text & " ..... ( in case of numeric value)

Regards,
Shurik.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup database destress Database and Reporting 3 07-14-2003 01:04 AM
Using SQL INSERT to place new data in an ACCESS DATABASE deathcrush Database and Reporting 0 06-17-2003 11:24 AM
can i insert image and upload info into database? freakskin Web Programming 3 04-03-2003 09:51 PM
Insert Null Into Database Kashif Database and Reporting 2 03-27-2003 07:56 AM
User-defined type not defined (im new) skript_kiddie General 8 06-16-2002 02:06 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->