Click here to Skip to main content
15,887,350 members

Comments by Kevin Brady (Top 31 by date)

Kevin Brady 30-Apr-23 9:55am View    
Thank you. This solution works.
Kevin Brady 21-Jan-23 11:41am View    
Port 587 worked in conjunction with setting an application specific password in Yahoo.
Kevin Brady 21-Jan-23 11:40am View    
Before posting this question, I did a google search for the issue. I found both of the above links as well as many others similar ones. None of them worked.

Yahoo mail and gmail have changed the method to programmatically access email services.

See this link: https://stackoverflow.com/questions/62030011/allow-less-secure-app-access-in-yahoo-mail

In Yahoo email, I had to generate an application specific password. After doing this, the solution was able to send emails.

Also, I had to change the port to 587.
Kevin Brady 7-Nov-21 8:22am View    
Thank you for the response. I thought that might be the case but also thought there might be some clever way to do what I was asking about that hadn't occurred to me.
Thank you also regarding code fragments. That could prove to be helpful for future development projects.
Kevin Brady 5-Feb-21 15:19pm View    
I have set the transfer parameter "CopyAllObjects = False". Now, only the desired table transferred. This seems to be the important parameter for the desired functionality.

Also, if I set "CopyData = True" the data transfers along with the table.

The revised complete code is now:

' copy a data table from one db to another
Public Sub CopyTable(ByVal iSourceServerName As String,
ByVal iTargetServerName As String,
ByVal iSrcDatabase As String,
ByVal iTargerDatabase As String,
ByVal iTblName As String,
ByVal CopyData As Boolean,
<out> ByRef iRetMsg As String)

Dim srcsrv = New Server(iSourceServerName)
Dim srcdb As Database = srcsrv.Databases(iSrcDatabase)
Dim iTbl = srcdb.Tables(iTblName) ' the table to transfer

Dim targetsrv = New Server(iTargetServerName)
Dim targetdb As New Database(targetsrv, iTargerDatabase)

Dim trans As New Transfer()
With trans
.Database = srcdb

.DestinationServer = iTargetServerName
.DestinationDatabase = iTargerDatabase
.DestinationLoginSecure = True
.ObjectList.Add(iTbl) ' only transfer the specified table
.CopyAllObjects = False
.CopyAllTables = False
.CopySchema = CopyData

.CopyData = True

With .Options
.ContinueScriptingOnError = True
.DriAllKeys = True
.WithDependencies = False
.DriAll = False
.DriDefaults = True
.DriIndexes = True
.DriPrimaryKey = True
.DriUniqueKeys = True
.DriForeignKeys = False
End With

End With

Try
trans.TransferData()

Catch ex As Exception
iRetMsg = ex.ToString

End Try

End Sub