Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Can someone please help me to fix an error ?

 
   Database Forums (Home) -> Visual Basic -> DAO RSS
Next:  query  
Author Message
Mac

External


Since: Mar 09, 2005
Posts: 2



(Msg. 1) Posted: Mon May 08, 2006 3:37 am
Post subject: Can someone please help me to fix an error ?
Archived from groups: microsoft>public>vb>database>dao, others (more info?)

I am using VB.NET.

I just created a form where user enters information. Once information is
entered, user clicks ok button.

While updating the table, I am getting an error and it does not update. I
am using 2 tables, INVSHIP and PARTSQTY. Both have comon column called
part. Once it matches, I want to grab the quantity from PARTSQTY table.


I would appreciate if someone please help.

Here is my coding:



Dim cn As ADODB.Connection

Dim rs As ADODB.Recordset

Dim strsql As String

Dim sqlsvrstr As String

Dim strcnn As String

'Dim userpassstr As String

Dim sqldbstr As String

Dim mcust As String

Dim mpallet As String

Dim mpart As String

Dim TEST As String





'

sqlsvrstr = "30.0.1.2"

sqldbstr = "m2mdata01"

strcnn = "driver=sql server; server=" & sqlsvrstr & ";" & _

"uid=sa;pwd=just4admin;database=" & sqldbstr & ";"

'

cn = New ADODB.Connection

'

rs = New ADODB.Recordset

rs.CursorType = ADODB.CursorTypeEnum.adOpenKeyset

rs.LockType = ADODB.LockTypeEnum.adLockOptimistic

'

TEST = MsgBox(Me.txtcust.Text)





mcust = Me.txtcust.Text

mpallet = Me.txtpallet.Text

mpart = Me.txtpart.Text

strsql = "update invship set invship.customer='" & mcust & " ', " & _

"invship.pallet = '" & mpallet & " ', invship.part = '" & mpart & "', " & _

"invship.qty = partsqty.qty from invship inner join " & _

"partsqty on invship.part = partsqty.part "

cn.Open(strcnn)

rs.Open(strsql, cn)

cn.Execute(strsql)

rs.Close()

cn.Close()

End Sub

End Class

 >> Stay informed about: Can someone please help me to fix an error ? 
Back to top
Login to vote
AGP

External


Since: Apr 29, 2005
Posts: 29



(Msg. 2) Posted: Fri May 12, 2006 5:33 pm
Post subject: Re: Can someone please help me to fix an error ? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

this is vb6 newsgroup.

AGP

"Mac" wrote in message

> I am using VB.NET.
>
> I just created a form where user enters information. Once information is
> entered, user clicks ok button.
>
> While updating the table, I am getting an error and it does not update. I
> am using 2 tables, INVSHIP and PARTSQTY. Both have comon column called
> part. Once it matches, I want to grab the quantity from PARTSQTY table.
>
>
> I would appreciate if someone please help.
>
> Here is my coding:
>
>
>
> Dim cn As ADODB.Connection
>
> Dim rs As ADODB.Recordset
>
> Dim strsql As String
>
> Dim sqlsvrstr As String
>
> Dim strcnn As String
>
> 'Dim userpassstr As String
>
> Dim sqldbstr As String
>
> Dim mcust As String
>
> Dim mpallet As String
>
> Dim mpart As String
>
> Dim TEST As String
>
>
>
>
>
> '
>
> sqlsvrstr = "30.0.1.2"
>
> sqldbstr = "m2mdata01"
>
> strcnn = "driver=sql server; server=" & sqlsvrstr & ";" & _
>
> "uid=sa;pwd=just4admin;database=" & sqldbstr & ";"
>
> '
>
> cn = New ADODB.Connection
>
> '
>
> rs = New ADODB.Recordset
>
> rs.CursorType = ADODB.CursorTypeEnum.adOpenKeyset
>
> rs.LockType = ADODB.LockTypeEnum.adLockOptimistic
>
> '
>
> TEST = MsgBox(Me.txtcust.Text)
>
>
>
>
>
> mcust = Me.txtcust.Text
>
> mpallet = Me.txtpallet.Text
>
> mpart = Me.txtpart.Text
>
> strsql = "update invship set invship.customer='" & mcust & " ', " & _
>
> "invship.pallet = '" & mpallet & " ', invship.part = '" & mpart & "', " &
_
>
> "invship.qty = partsqty.qty from invship inner join " & _
>
> "partsqty on invship.part = partsqty.part "
>
> cn.Open(strcnn)
>
> rs.Open(strsql, cn)
>
> cn.Execute(strsql)
>
> rs.Close()
>
> cn.Close()
>
> End Sub
>
> End Class
>
>

 >> Stay informed about: Can someone please help me to fix an error ? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Authentication Error??? - Ok so heres the code.. for some reason I kept getting the no permissions message, so I attempted to add the access workgroup file. Now I get the "Authentication Failed" message. This is a secure database. HELP.. I know I'm writing (adding) som...

Runtime Error 91 - Hi I have a VB6 Application wich connect to an Access 97 database. We have a function to connect to the database like this Dim wrkDefault As Workspace Set wrkDefault = DBEngine.Workspaces(0) Set objDatabase =..

dao recordset error trapping - I have a dao recordset which I update with the following code: With rsOrderShip .Edit !CustCode = frmOrders.txtSTCustCode.Text !stcustname = frmOrders.txtSTCustName.Text !staddress1 = frmOrders.txtSTAddress1.Text ....

Error 3167 recordset is delete - Hello, ich habe in verschiedenen Newsgroups gesucht aber keine Lösung zu dem folgenden Problem gefunden. Zwei Personen arbeiten gemeinsam mit einem VB6-Programm an einer ACCESS 2000 Datenbank Der Zugriff von VB auf ACCESS erfolgt mit DAO 3.60. Eine de...

error 3167 "record deleted" - Hello, I have searched in newsgroup for the following error and found nothing which can help me. Two people are working together with an visual basic application in one database. The database is access 2000 and visual basic makes an connection to the..
   Database Forums (Home) -> Visual Basic -> DAO All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]