我有一个应用程序,该应用程序通过QBFC13连接到QuickBooks,下载了客户(只是姓名,ID和其他一些详细信息)以及这些客户的所有已知地址。除了没有GUID或我可以看到的唯一标识地址的其他唯一标识符之外,这一切似乎都可以正常工作。因此,例如,客户更改了QuickBooks中的地址,我需要知道应用程序中更改了哪个地址。或者,我使用地址ID而不是整个Addr1-5将信息发送到QuickBooks。我以为地址名称是唯一的,但不是,可以空白。取消添加地址字段的实用性或实用性。 这个GUID甚至存在吗?我是否错过了一些非常简单的事情?有一个更好的方法吗? QB文档太糟糕了!
用于吸引客户及其地址的VBA紧随其后(为了清晰起见,一些代码被删除了)。
Dim respType As IResponseType
Set respType = curResp.Type
If (respType.getValue = rtCustomerQueryRs) Then
Dim custList As ICustomerRetList
Set custList = curResp.Detail
Dim curCust As ICustomerRet
Dim i As Integer
Dim insSQL As String
For i = 0 To custList.Count - 1
insSQL = "INSERT INTO " & CustomerTableName _
& "(CustomerID, QBEditSequence, Name, PhoneNumber, EMailAddress) " _
& "VALUES " _
& "("
Set curCust = custList.GetAt(i)
If (curCust.Sublevel.getValue = 0) Then
insSQL = insSQL & "'" & curCust.ListID.getValue & "',"
insSQL = insSQL & "'" & curCust.EditSequence.getValue & "',"
insSQL = insSQL & "'" & Replace(curCust.Name.getValue, "'", "''") & "',"
If (Not curCust.Phone Is Nothing) Then
insSQL = insSQL & "'" & curCust.Phone.getValue & "',"
Else
insSQL = insSQL & "'',"
End If
If (Not curCust.Email Is Nothing) Then
insSQL = insSQL & "'" & curCust.Email.getValue & "');"
Else
insSQL = insSQL & "'');"
End If
accessDB.Execute insSQL
' Add Bill to address
If Not curCust.BillAddressBlock Is Nothing Then
If curCust.BillAddressBlock.Addr1 Is Nothing = False Then
rs.AddNew
rs!CustomerID = curCust.ListID.getValue
rs!AddressType = "B"
rs!Addr1 = curCust.BillAddressBlock.Addr1.getValue
If curCust.BillAddressBlock.Addr2 Is Nothing = False Then rs!Addr2 = curCust.BillAddressBlock.Addr2.getValue
If curCust.BillAddressBlock.Addr3 Is Nothing = False Then rs!Addr3 = curCust.BillAddressBlock.Addr3.getValue
If curCust.BillAddressBlock.Addr4 Is Nothing = False Then rs!Addr4 = curCust.BillAddressBlock.Addr4.getValue
If curCust.BillAddressBlock.Addr5 Is Nothing = False Then rs!Addr5 = curCust.BillAddressBlock.Addr5.getValue
rs.Update
End If
End If
' Add Shipping Addresses
Dim shpList As IShipToAddressList
Set shpList = curCust.ShipToAddressList
If Not shpList Is Nothing Then
Dim s As Integer
For s = 0 To shpList.Count - 1
Dim saddr As IShipToAddress
Set saddr = shpList.GetAt(s)
rs.AddNew
rs!CustomerID = curCust.ListID.getValue
rs!AddressType = "S"
rs!AddressName = saddr.Name.getValue
rs!IsDefault = saddr.DefaultShipTo.getValue
rs!Addr1 = saddr.Addr1.getValue
If saddr.Addr2 Is Nothing = False Then rs!Addr2 = saddr.Addr2.getValue
If saddr.Addr3 Is Nothing = False Then rs!Addr3 = saddr.Addr3.getValue
If saddr.Addr4 Is Nothing = False Then rs!Addr4 = saddr.Addr4.getValue
If saddr.Addr5 Is Nothing = False Then rs!Addr5 = saddr.Addr5.getValue
rs.Update
Next s
End If
End If
Next i
End If
End If
答案 0 :(得分:1)
几年前使用qb并审查了该时期的一些项目。请注意,这是由客户端内部的qb报告编写者提取的,最有把握地传递了截断的记录。
没有预定义的全局唯一地址标识符作为特定地址的单个字段。客户/供应商名称对于各自的“从/到”,“从/到”而言是唯一的,但是帐单邮寄地址可以与送货地址相同,其他公司也可以并且确实使用相同的地址。 这实际上在几种类型的业务中非常普遍。
因此1的帐单是供应商的唯一标头/名称,但地址字符串本身也可以出现在2的帐单中,从3到5的帐单出现,然后从街道,街道2,城市,州,邮政编码,国家和所有这些字段汇总起来创建一个长地址字符串,简称为from。
可悲的是,我只有xlsxm和csv。不再具有访问qb的权限,因此我无法仔细查看实际上会提供有用信息的