vb.net을 사용하여 액세스 2010 databse에 쓰려고합니다. 나는 그것을 작동 시켰지만 이전 데이터베이스를 지우고 새 데이터베이스를 만들어야 만했습니다. 작동하지 않습니다. 여기 내가 가지고있는 코드는 : 나는 새로운 데이터 집합, TableAdpater했습니다, 나는 또한 새로운 데이터베이스에 대한 연결을 만들어 내 새 데이터베이스를 만든Access 2010 데이터베이스에 쓰기
Dim ConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Forte\Fortedb.accdb"
Dim cnn As New OleDbConnection(ConnString)
cnn.Open()
'Naming the new Row in Query1.
Dim newQuery1Row As FortedbDataSet.Query1Row
newQuery1Row = Me.FortedbDataSet1.Query1.NewQuery1Row()
'Making the first row the date.
newQuery1Row.ProdDate = GlobalVariables.mdbProdDate
newQuery1Row.BaleLine = GlobalVariables.mdbBaleLine
newQuery1Row.BaleNumber = GlobalVariables.mdbBaleNumber
newQuery1Row.GrossWeight = GlobalVariables.mdbGrossWeight
newQuery1Row.AirDry = GlobalVariables.mdbAirDry
newQuery1Row.InvoiceWeight = GlobalVariables.mdbInvoiceWeight
'Adding the row to the table.
Me.FortedbDataSet1.Query1.Rows.Add(newQuery1Row)
cnn.Close()
'Saving the row in Access.
Me.Query1TableAdapter.Update(Me.FortedbDataSet1.Query1)
. 나는 뭔가를 간과해야합니다.
"작동하지 않음"을 정의하십시오. 예외 메시지는 무엇입니까? 스택 트레이스? – EkoostikMartin
오류 메시지가 표시되지 않습니다. 그것은 잘 실행되지만 내 데이터베이스에 저장되지 않습니다. 나는 무엇이 일어나고 있는지 완전히 확신하지 못한다. –
데이터 세트 및 테이블 어댑터 정의 방법을 알지 못해서 알기가 어렵습니다. – EkoostikMartin